<record model="ir.ui.view" id="view_order_form">
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="priority" eval="20" />
<field name="arch" type="xml">
...
<xpath expr="//field[@name='order_line']/tree//field[@name='product_id']"
position="before">
<field name="product_tmpl_id" />
</xpath>
...<record id="custom_sale_order_form" model="ir.ui.view">
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="priority" eval="10" />
<field name="arch" type="xml">
<xpath expr="//tree/field[@name='product_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
<record id="custom2_sale_order_form" model="ir.ui.view">
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale_variant_configurator.view_order_form"/>
<field name="priority" eval="10" />
<field name="arch" type="xml">
<xpath expr="//field[@name='product_tmpl_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
<xpath expr="//xpath/expr[@name='//field[@name='order_line']/tree//field[@name='product_id']']/field[@name='product_tmpl_id']"
position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='order_line']/tree//field[@name='product_id']"
position="before">
<field name="product_tmpl_id" />
</xpath>
<record model="ir.ui.view" id="view_order_form">
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="priority" eval="20" />
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/tree" position="attributes">
<attribute name="editable"/>
</xpath>
<xpath expr="//field[@name='order_line']/tree//field[@name='product_id']"
position="before">
<field name="product_tmpl_id" />
</xpath>
<xpath expr="//field[@name='order_line']" position="attributes">
<attribute name="options">{'reload_on_button': true}</attribute>
</xpath>
<xpath expr="//field[@name='order_line']/form//field[@name='product_id']"
position="before">
<field name="product_tmpl_id" />
<field name="product_attribute_ids"
context="{'default_owner_model': 'sale.order.line', 'default_owner_id': id}"
attrs="{'invisible':[('product_attribute_ids','=',[])]}">
<!-- We are not using isolated view because onchange doesn't work in this case -->
<tree create="0" delete="0" editable="1">
<field name="owner_model" invisible="1"/>
<field name="owner_id" invisible="1"/>
<field name="attribute_id" />
<field name="possible_value_ids" widget="many2many_tags" invisible="1"/>
<field name="product_tmpl_id" invisible="1"/>
<field name="value_id"/>
<field name="price_extra"/>
</tree>
</field>
</xpath>
</field>
</record>
<record id="custom2_sale_order_form" model="ir.ui.view">
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale_variant_configurator.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/tree//field[@name='product_tmpl_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
<xpath expr="//field[@name='order_line']/tree//field[@name='product_tmpl_id']"
<record model="ir.ui.view" id="view_order_form">
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="priority" eval="20" />
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/tree" position="attributes">
<attribute name="editable"/>
</xpath>
<xpath expr="//field[@name='order_line']/tree//field[@name='product_id']"
position="before">
<field name="product_tmpl_id" />
</xpath>
<xpath expr="//field[@name='order_line']" position="attributes">
<attribute name="options">{'reload_on_button': true}</attribute>
</xpath>
<xpath expr="//field[@name='product_tmpl_id']"
<xpath expr="//xpath/field[@name='product_tmpl_id']"