我可以设置笔记本/页面

时间:2019-08-12 10:21:36

标签: odoo-11

我已覆盖account.invoice_supplier_form,并添加了看板视图

    <record id="invoice_supplier_form_inherit" model="ir.ui.view">
        <field name="name">account.invoice.supplier.form.inherit</field>
        <field name="model">account.invoice</field>
        <field name="inherit_id" ref="account.invoice_supplier_form"/>
        <field name="arch" type="xml">
            <xpath expr="//notebook/page/field[@name='invoice_line_ids']" position="attributes">
                <attribute name="mode">tree,kanban</attribute>
            </xpath>
            <xpath expr="//notebook/page/field[@name='invoice_line_ids']" position="inside">
                <kanban class="o_kanban_mobile">
                   ...

因此,笔记本中的页面现在支持两种视图-invoice_line_ids的树和看板。我想将看板设置为默认视图。我该怎么办?

...

1 个答案:

答案 0 :(得分:0)

您尝试过吗:

 <xpath expr="//notebook/page/field[@name='invoice_line_ids']" position="attributes">
        <!-- reverse the order here -->
        <attribute name="mode">kanban,tree</attribute>
   </xpath>

    <!-- and here make sure the kanban is the first tag inside the field tag -->    
    <xpath expr="//notebook/page/field[@name='invoice_line_ids']/tree" position="before">
        <kanban class="o_kanban_mobile">
        ....
        ....