Skip to Content
Menú
This question has been flagged
2 Respostes
354 Vistes

How can i change the description of the field? I use odoo 18 and with this example it does not work. The label remains the same.

<record id="view_purchase_order_form" model="ir.ui.view">

​<field name="name">purchase.order.form</field>

          <field name="model">purchase.order</field>

          <field name="inherit_id" ref="purchase.purchase_order_form"/>

          <field name="arch" type="xml">

                 <xpath expr="//field[@name='order_line']/form//field[@name='product_uom']" position="attributes">

                    <attribute name="string">Mengeneinheit</attribute>

                </xpath>                   

            </field>

</record>

Avatar
Descartar
Autor

Hello everyone, 

thank you the example works.

Best Answer

Hello,

Your code will change it in order_line form view but if you want to change it for list view use the below:

I used [@name='product_uom'][2] because there are two fields with name product_uom

<record id="view_purchase_order_form" model="ir.ui.view">

​<field name="name">purchase.order.form</field>

          <field name="model">purchase.order</field> ​ ​

          <field name="inherit_id" ref="purchase.purchase_order_form"/>

          <field name="arch" type="xml">

                 <xpath expr="//field[@name='order_line']//list//field[@name='product_uom'][2]" position="attributes">

                    <attribute name="string">Mengeneinheit</attribute>

                </xpath>                   

            </field>

</record>

Result will look like:

Avatar
Descartar
Best Answer

Hi,


Try with the following code.

<xpath expr="//field[@name='order_line']//list//field[@name='product_uom'][2]" position="attributes">
<attribute name="string">Mengeneinheit</attribute>
</xpath>

Hope it helps

Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de juny 25
383
2
de febr. 25
2430
0
de març 15
3738
3
d’ag. 25
485
1
d’ag. 25
166