XML field position behind an inherited form [ Odoo ]

Question:

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! 😀

<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>
Asked By: Luciano Ortiz

||

Answers:

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>
Answered By: Kenly

You can try this way.

<xpath expr="//field[@name='partner_shipping_id']" position="after">
.....Your code
</xpath>
Answered By: IJPatel
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.