为什么我看不到我在 Odoo 中创建的自定义应用程序?

问题描述 投票:0回答:1

所以我一直在尝试学习Odoo16开发,并且我正在遵循文档,但问题是,在启用

access rights
后,我在常规设置中看不到我的自定义应用程序。

这是我的目录。

模型.py

from odoo import fields, models

class RealEstate(models.Model):
    _name = 'estate_property'
    _description = 'Real Estate Property'

    name = fields.Char(string="Name", required=True)
    description = fields.Text(string="Description")
    postcode = fields.Char(string="Postcode")
    date_availability = fields.Date(string="Date")
    expected_price = fields.Float(string="Expected Price",  required=True)
    selling_price = fields.Float(string="Selling Price", required=True)
    bedrooms = fields.Integer(string="Bedrooms")
    living_area = fields.Integer(string="Living Area")
    facades = fields.Integer(string="Facades")
    garage = fields.Boolean(string="Garage")
    garden = fields.Boolean(string="Garden")
    garden_area = fields.Integer(string="Garden Area")
    garden_orientation = fields.Selection(
        string="Garden Orientation",
        selection=[('north', 'North'), ('east','East'), ('south','South'), ('west','west') ]
    )

清单.py

{
    "name": "Estate",  # The name that will appear in the App list
    "version": "16.0",  # Version
    "application": True,  # This line says the module is an App, and not a module
    "depends": ["base"],  # dependencies
    "data": [
        'security/ir.model.access.csv',
        'views/estate_property_views.xml',
        'views/estate_menus.xml'
    ],
    "installable": True,
    'license': 'LGPL-3',
}

ir.model.access.csv

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
estate.access_estate_property,access_estate_property,estate.model_estate_property,base.group_user,1,1,1,1

进一步搜索后,我读到我应该注释/取消注释 xml 文件,但它仍然不起作用。

estate_menus.xml

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <menuitem id="estate_menu_root" name="Estate Property">
            <menuitem id="estate_first_level_menu" name="First Level">
                <menuitem id="estate_property_menu_action" action="estate_property_action"/>
            </menuitem>
        </menuitem>

    </data>
</odoo>

estate_property_views.xml

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <record id="estate_property_action" model="ir.actions.act_window">
            <field name="name">Properties</field>
            <field name="res_model">estate_property</field>
            <field name="view_mode">tree,form</field>
        </record>
    </data>
</odoo>

我现在陷入了这个问题,我尝试更改为

superuser
,但它可以工作一次,但是一旦我刷新浏览器,自定义应用程序就会消失

添加

这是我的odoo.conf

[options]
admin_passwd = $pbkdf2-sha512$25000$7N07x/hf670XwvjfG2OMsQ$4bzF6iN4y0uxX3o915LeEAznINV1e8bZMf1c6rkyOX4Q5UfZE5uMYsvQwiY89IIZ2b61izNr3uVqEnbV3b6kxQ
db_host = localhost
db_port = 5432
db_user = admin
db_password = admin
addons_path = addons , customaddons
http_port = 8015
python xml odoo
1个回答
0
投票

分享您的插件路径并创建树和表单然后检查

© www.soinside.com 2019 - 2024. All rights reserved.