除了写序列优先绑定之外,
窗口引用的视图id也要绑定,否则页面加载的时候,可能不是自己需要显示的视图。例如:<field name="view_id" ref="cus_111_tree"/>
<record id="action_customs_×××××××" model="ir.actions.act_window"> <field name="name">测试</field> <field name="type">ir.actions.act_window</field> <field name="res_model">xxxxx.customs_×××××××</field> <field name="view_mode">tree,form</field> </record> <record id="import_customs_×××××××_action" model="ir.actions.act_window"> <field name="name">测试进口菜单1</field> <field name="type">ir.actions.act_window</field> <field name="res_model">xxxxx.customs_×××××××</field> <field name="view_mode">tree,form</field> <field name="domain">[('inout', '=', 'I'),]</field> <field name="view_id" ref="cus_111_tree"/> </record> <record id="export_customs_×××××××_action" model="ir.actions.act_window"> <field name="name">测试出口菜单2</field> <field name="type">ir.actions.act_window</field> <field name="res_model">xxxxx.customs_×××××××</field> <field name="view_mode">tree,form</field> <field name="domain">[('inout', '=', 'E'),]</field> <field name="view_id" ref="cus_111_tree"/> </record> <record id="cus_111_tree" model="ir.ui.view"> <field name="name">XXXXXXXXX tree view</field> <field name="model">XXXXX.XXXXX</field> <field name="arch" type="xml"> <tree default_order="create_date desc" > <field name="name"/> <field name="inout"/> <field name="create_uid" readonly="1" string="创建人"/> <field name="create_date" string="创建时间" widget="date"/> </tree> </field> </record>