有一个问题是sequence写在view_ids中起作用,单独写ir.actions.act_window.view(把view_ids注释掉的情况),反而报错的。
是```ir.actions.act_window```中写```view_ids```了,``sequence```写在```view_ids```中起作用。解决方法如下代码:
<record id="product_template_action_all" model="ir.actions.act_window">
<field name="name">Parts</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.template</field>
<field name="view_mode">tree,kanban,form</field>
<field name="view_type">form</field>
<field name="context">{}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new product.
</p>
</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'sequence': '1', 'view_mode': 'tree', 'view_id': ref('product_template_tree_view')}),
(0, 0, {'sequence': '2', 'view_mode': 'kanban', 'view_id': ref('product_template_kanban_view')}),
(0, 0, {'sequence': '3', 'view_mode': 'form', 'view_id': ref('product_template_form_view')})]"/>
</record>