How to move a field in a view?

  • language
      English
  • type
      technical
  • info created for version
      14.0
  • mvc
      XML (records/views/templates)
Add to Cart

<data>
  <xpath expr="//field[@name='active']" position="before">
    <xpath expr="//field[@name='barcode']" position="move"/>
  </xpath>
</data>

Before Odoo 12 you first have to set the moving field to invisible and adding it again at the right position!

<field name="product_brand_id" position="attributes">
    <attribute name="invisible">1</attribute>
</field>
<field name="name" position="before">
    <field name="product_brand_id"/>
</field>