Procházet zdrojové kódy

上传文件至 ''

第一个自定义模块写入
longyuan před 1 měsícem
rodič
revize
476942777f
3 změnil soubory, kde provedl 36 přidání a 0 odebrání
  1. 1 0
      __init__.py
  2. 23 0
      __manifest__.py
  3. 12 0
      hostel.py

+ 1 - 0
__init__.py

@@ -0,0 +1 @@
+from . import hostel

+ 23 - 0
__manifest__.py

@@ -0,0 +1,23 @@
+{
+    "name": "Hostel_Management",
+    "summary": "manage hostel easily",
+    "description": "高效管理学校内的整个酒店",
+    "author": "admin1",
+    "website": "http://localhost:127.0.0.1:8069?debug=1",
+    "category": "Uncategorized",
+    "version": "17.0.1.0.0",
+    "depends": ["base"],
+    "images":"./static/description/output.png",
+    "data": [
+        #"security/ir.model.access.csv",
+        "security/hostel_security.xml",
+        "security/ir.model.access.csv",
+        "views/hostel.xml",
+        #"demo/demo.xml"
+    ],
+    "assets": {
+        "web.assets_backend": [
+            "my_hostel/static/src/xml/**/*",
+        ],
+    },
+}

+ 12 - 0
hostel.py

@@ -0,0 +1,12 @@
+from odoo import models, fields
+
+
+class Hostel(models.Model):
+    _name = 'hostel.hostel'
+    _description = 'Information about hostel'
+
+    name = fields.Char(string='Hostel name', required=True)
+    hostel_code = fields.Char(string='Code', required=True)
+    street = fields.Char('Street')
+    street2 = fields.Char('Street2')
+    state_id = fields.Many2one('res.country.state', string='State')