浏览代码

更改一下hostel——security.xml

longyuan 1 月之前
父节点
当前提交
0a91e5574d

+ 3 - 0
.idea/.gitignore

@@ -0,0 +1,3 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml

+ 6 - 0
.idea/MarsCodeWorkspaceAppSettings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="com.codeverse.userSettings.MarscodeWorkspaceAppSettingsState">
+    <option name="ckgOperationStatus" value="SUCCESS" />
+  </component>
+</project>

+ 6 - 0
.idea/inspectionProfiles/profiles_settings.xml

@@ -0,0 +1,6 @@
+<component name="InspectionProjectProfileManager">
+  <settings>
+    <option name="USE_PROJECT_PROFILE" value="false" />
+    <version value="1.0" />
+  </settings>
+</component>

+ 7 - 0
.idea/misc.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Black">
+    <option name="sdkName" value="Python 3.13" />
+  </component>
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13" project-jdk-type="Python SDK" />
+</project>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/my_hostel.iml" filepath="$PROJECT_DIR$/.idea/my_hostel.iml" />
+    </modules>
+  </component>
+</project>

+ 8 - 0
.idea/my_hostel.iml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="jdk" jdkName="Python 3.13" jdkType="Python SDK" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 7 - 0
.idea/vcs.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+    <mapping directory="$PROJECT_DIR$/../../odoo/.github" vcs="Git" />
+  </component>
+</project>

+ 4 - 0
__init__.py

@@ -0,0 +1,4 @@
+from . import models
+from . import controllers
+from . import wizards
+

+ 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/**/*",
+        ],
+    },
+}

二进制
__pycache__/__init__.cpython-312.pyc


+ 0 - 0
controllers/__init__.py


二进制
controllers/__pycache__/__init__.cpython-312.pyc


+ 1 - 0
models/__init__.py

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

二进制
models/__pycache__/__init__.cpython-312.pyc


二进制
models/__pycache__/hostel.cpython-312.pyc


+ 12 - 0
models/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')

+ 28 - 0
security/hostel_security.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+<record id="module_category_hostel" model="ir.module.category">
+    <field name="name">Hostel Management</field>
+    <field name="sequence">31</field>
+</record>
+<record id="group_hostel_manager" model="res.groups">
+    <field name="name">Hostel Manager</field>
+    <field name="category_id" ref="module_category_hostel"/>
+    <field name="users" eval="[(4, ref('base.user_root')),(4, ref('base.user_admin'))]"/>
+</record>
+<record id="group_hostel_user" model="res.groups">
+    <field name="name">Hostel User</field>
+    <field name="category_id" ref="module_category_hostel"/>
+    <field name="users" eval="[(4, ref('base.user_root')),(4, ref('base.user_admin'))]"/>
+</record>
+<record id="action_hostel" model="ir.actions.act_window">
+        <field name="name">Hostel</field>
+        <field name="type">ir.actions.act_window</field>
+        <field name="res_model">hostel.hostel</field>
+        <field name="view_mode">tree,form</field>
+        <field name="help" type="html">
+            <p class="oe_view_nocontent_create">
+                Create Hostel.
+            </p>
+        </field>
+    </record>
+</odoo>

+ 6 - 0
security/ir.model.access.csv

@@ -0,0 +1,6 @@
+id
+access_hostel_manager_id
+access_hostel_user_id
+
+
+

+ 4 - 0
static/description/hostel.jpg:Zone.Identifier

@@ -0,0 +1,4 @@
+[ZoneTransfer]
+ZoneId=3
+ReferrerUrl=https://cn.bing.com/
+HostUrl=https://pic.616pic.com/ys_bnew_img/00/23/93/laFZHzMT05.jpg

二进制
static/description/icon.jpg


二进制
static/description/output.png


+ 46 - 0
views/hostel.xml

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<odoo>
+    <data>
+        <!-- Hostel Tree View -->
+        <record id="view_hostel_tree" model="ir.ui.view">
+            <field name="name">hostel.hostel.tree</field>
+            <field name="model">hostel.hostel</field>
+            <field name="arch" type="xml">
+                <tree>
+                    <field name="name"/>
+                    <field name="hostel_code"/>
+                </tree>
+            </field>
+        </record>
+
+        <!-- Hostel Form View -->
+        <record id="view_hostel_form" model="ir.ui.view">
+            <field name="name">hostel.hostel.form</field>
+            <field name="model">hostel.hostel</field>
+            <field name="arch" type="xml">
+                <form>
+                    <sheet>
+                        <group>
+                            <field name="name"/>
+                            <field name="hostel_code"/>
+                            <field name="street"/>
+                            <field name="street2"/>
+                            <field name="state_id"/>
+                        </group>
+                    </sheet>
+                </form>
+            </field>
+        </record>
+
+        <!-- Hostel Action -->
+        <record id="action_hostel" model="ir.actions.act_window">
+            <field name="name">Hostels</field>
+            <field name="res_model">hostel.hostel</field>
+            <field name="view_mode">tree,form</field>
+        </record>
+
+        <!-- Hostel Menu -->
+        <menuitem id="menu_hostel_root" name="Hostel"/>
+        <menuitem id="menu_hostel" name="Hostels" parent="menu_hostel_root" action="action_hostel"/>
+    </data>
+</odoo>

+ 0 - 0
wizards/__init__.py


二进制
wizards/__pycache__/__init__.cpython-312.pyc