我有这段代码:
<record id="view_origen_form" model="ir.ui.view">
<field name="name">origen.form</field>
<field name="model">origen</field>
<field name="arch" type="xml">
<form string="Origen">
<group>
<field name="origen"/>
</group>
</form>
</field>
</record>
<record id="view_origen_tree" model="ir.ui.view">
<field name="name">origen.tree</field>
<field name="model">origen</field>
<field name="arch" type="xml">
<tree string="Origen">
<field name="origen"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="origen_view">
<field name="name">Origen</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">origen</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<record id="view_destino_form" model="ir.ui.view">
<field name="name">destino.form</field>
<field name="model">destino</field>
<field name="arch" type="xml">
<form string="Destino">
<group>
<field name="destino"/>
</group>
</form>
</field>
</record>
<record id="view_destino_tree" model="ir.ui.view">
<field name="name">destino.tree</field>
<field name="model">destino</field>
<field name="arch" type="xml">
<tree string="Destino">
<field name="destino"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="destino_view">
<field name="name">Destino</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">destino</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
然后,每个菜单操作:
<menuitem name="Origen" action="origen_view" id="origen_view_menu" parent="fleet.fleet_configuration"/>
<menuitem name="Destino" action="destino_view" id="destino_view_menu" parent="fleet.fleet_configuration"/>
我没理解,项目根本没有显示。
我从fleet
模块继承此视图:
<menuitem name="Configuration" parent="menu_root" id="fleet_configuration" sequence="100" groups="group_fleet_manager"/>
有什么想法吗?
答案 0 :(得分:1)
在Odoo中添加视图,菜单项或任何xml资产时,请记住在清单中引用该文件。
这可能是__openerp__.py
或__manifest__.py
,具体取决于您运营的Odoo版本。