Home > Net >  XML field position behind an inherited form [ Odoo ]
XML field position behind an inherited form [ Odoo ]

Time:09-01

I want to do this in XML

PICTURE

1

This is my actual code. I want the field shipment_preferente to be just behind the last inherited data. Hope you can help me with this guys! :D

<record model="ir.ui.view" id="view_order_form_inherit">
        <field name="name">sale.order.form.inherit</field>
        <field name="model">sale.order</field>
        <field name="priority">15</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
        <field name="arch" type="xml">
            <xpath expr="//button[@name='action_cancel']" position="after">
               ...
            </xpath>

            <xpath expr="//button[@name='action_cancel']" position="attributes">
                ...
            </xpath>


            <field name="payment_term_id" position="after">
                <field name="shipment_preference"/>
                <field name="business_unit_id" options="{'no_create': True, 'no_open': True}"/>
                <field name="order_type_id" options="{'no_create': True, 'no_open': True}"/>
            </field>

CodePudding user response:

The Delivery address field (partner_shipping_id) is defined in order_view_form inside the partner_details group.

You can use the following code to show your fields after the delivery address:

<field name="partner_shipping_id" position="after">
           
</field>

Or (The default position is inside):

<group name="partner_details">
            
</group>
  • Related