代码之家  ›  专栏  ›  技术社区  ›  user1

我可以在笔记本/页面中设置字段的默认查看模式吗

  •  0
  • user1  · 技术社区  · 6 年前

    我已经超越了 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 . 我想将看板设置为默认视图。我该怎么做?

    0 回复  |  直到 6 年前
        1
  •  0
  •   Charif DZ    5 年前

    你试过这个吗:

     <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">
            ....
            ....
    
    推荐文章