1. 程式人生 > >odoo欄位位置調整

odoo欄位位置調整

同一個頁面,不同的檢視欄位位置調整不可用invisible,而要要replace空之後,再做欄位新增
<record id="sale_order_form_inherit_account_budget" model="ir.ui.view"> <!--在銷售訂單其他選項page隱藏要求日期-->
        <field name="name">sale_order_form_inherit_account_budget</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale_order_dates.view_order_form_inherit_sale_stock_inherit_sale_order_dates"/>
        <field name="arch" type="xml">
            <xpath expr="//group[@name='sale_shipping']/field[@name='requested_date']" position="replace"/>
                <!--<attribute name="invisible">1</attribute>-->
            <!--</xpath>-->
        </field>
    </record>
    <record id="sale_order_form_inherit" model="ir.ui.view"> <!--在銷售訂單form上加欄位-->
        <field name="name">sale_order_form_inherit</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='payment_term_id']" position="after">
                <field name="picking_policy" required="True"/>
                <field name="requested_date" required="True"/>
            </xpath>
        </field>
    </record>