gpt4 book ai didi

odoo - OpenERP 7.0中ir.ui.menu有什么用?

转载 作者:行者123 更新时间:2023-12-02 17:06:04 24 4
gpt4 key购买 nike

我是 OpenERP 的新手,我想了解 OpenERP 中的 model="ir.ui.menu" 是什么。像这样的还有很多其他模型。

例如:

model="ir.ui.view"

model="ir.actions.act_window"

谁能解释一下这一切吗?

最佳答案

使用ir.ui.menu模型,您可以创建新的菜单项。您可以使用 menuitem 标签,它是快捷方式:

<record id="menu_human_readable_name" model="ir.ui.menu" >
<field name="name">Human readable name</field>
<field name="sequence" eval="10" />
<field name="action" ref="action_name" />
<field name="parent_id" ref="base.menu_custom" />
</record>

您对 ir.actions.act_window 模型有一个简短的解释 in the Odoo documentation 。您可以在ir.ui.menu模型的action字段中分配此类操作的id

The most common action type, used to present visualisations of a model through views: a window action defines a set of view types (and possibly specific views) for a model (and possibly specific record of the model).

<record id="action_human_readable_name_act_window" model="ir.actions.act_window">
<field name="type">ir.actions.act_window</field>
<field name="name">Human readable name</field>
<field name="res_model">model.name</field>
<field name="view_mode">tree,form</field>
<field name="view_type">form</field>
<field name="target">current</field>
<field name="domain">[]</field>
<field name="context">{}</field>
<field name="search_view_id" ref="ir.ui.view" />
</record>

ir.ui.view 用于显示字段或树列表的 View

您可以在 Odoo Documentation 中了解更多信息:

Views define the way the records of a model are displayed. Each type of view represents a mode of visualization (a list of records, a graph of their aggregation, …). Views can either be requested generically via their type (e.g. a list of partners) or specifically via their id. For generic requests, the view with the correct type and the lowest priority will be used (so the lowest-priority view of each type is the default view for that type).

<record model="ir.ui.view" id="view_id">
<field name="name">view.name</field>
<field name="model">object_name</field>
<field name="priority" eval="16"/>
<field name="arch" type="xml">
<!-- view content: <form>, <tree>, <graph>, ... -->
[...]
<field name="field_name" />
[...]
</field>
</record>

关于odoo - OpenERP 7.0中ir.ui.menu有什么用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32136702/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com