python-2.7之是否可以在 Openerp 中显示同一对象的多个表单 View 或 TreeView

davidwang456 阅读:35 2025-02-15 21:57:57 评论:0

我的模块中需要同一对象的多个表单 View ,我创建了多个表单,但 OpenERP 仅显示与该对象相关的一个表单,其他表单被隐藏。我查看了文档,但没有答案。如果有人知道,请帮助。提前致谢。

请您参考如下方法:

是的。只需为对象制作一个单独的操作和菜单。例如

<record model="ir.actions.act_window" id="client_form_action"> 
    <field name="name">client.form.action</field> 
    <field name="res_model">client</field> 
    <field name="view_type">form</field> 
    <field name="view_mode">form</field> 
</record> 
 
<!--This action open the view we specify.--> 
<record model="ir.actions.act_window" id="client_form_action1"> 
    <field name="name">client.form.action1</field> 
    <field name="res_model">client</field> 
    <field name="view_type">form</field> 
    <field name="view_mode">form</field> 
    <field name="view_id" ref="client_form_view_1"/> 
</record> 
 
<menuitem id="menu_id" name="Client main menu"/> 
<menuitem 
    id="menu_id_1" 
    name="Here we don't specify the view" 
    action="client_form_action" parent="menu_id"/> 
<menuitem 
    id="menu_id_1" 
    name="Here we specify the view" 
    action="client_form_action1" parent="menu_id"/> 

使用 View Id="some_thing"你可以做到,默认情况下第一个 View 是指定的第二个 View ,你也可以通过给予它们优先级来只显示你想要的 View 。希望这会有所帮助 点击here !


标签:Python
声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

关注我们

一个IT知识分享的公众号