This question has been flagged
3 Replies
14970 Views

Hi,

I want to change the label name of description to ID in account.invoice.refund wizard not the field so  want to use the same char type via xpath .How it is possible .need help............

 

<record id="magento_refund_wizard_form" model="ir.ui.view">
            <field name="name">magento.refund.wizard.form</field>
            <field name="model">account.invoice.refund</field>
            <field name="inherit_id" ref="account.view_account_invoice_refund"/>
            <field name="arch" type="xml">
             <xpath expr="/form/group/group[1]/div/field[@name='filter_refund']" position="after">
                     <group>
                         
                     <field name="amount"/>
                        <field name="stock_anyitem"/>
                <field name="refund_reason"/>
                     
                         </group>
        </xpath>
        
        <xpath expr="/form/group/group[2]/field[1][@name='description']" position="replace">
           <label for="description" string="ID"/>


           </xpath>

 

# Here i  want to change only the label name of description field  to ID not the char type . current xpath is not working because it replaces to ID but the char type area is vanish .So How to write the xpath

Avatar
Discard
Author

<xpath expr="/form/group/group[2]/field[1][@name='description']" position="replace"> <field name="description" string="ID"/> </xpath>

Author

<xpath expr="/form/group/group[2]/field[1][@name='description']" position="replace"> <field name="description" string="ID"/> </xpath>

Best Answer

Hi, try this...

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

<label for="description" position="replace">
                    <label string="ID" for="description"  />
</label>

</field>

Avatar
Discard
Author

Hi Dhinesh , error occurs in xml,i already tried that one use xpath like-------- <xpath expr="/form/group/group[2]/field[1][@name='description']" position="replace">

Best Answer

Try this,

<xpath expr="//field[@name='description']" position="attributes">
          <attribute name="string">ID</attribute>
</xpath>

This changes the label value of field "description" to ID.

Avatar
Discard
Best Answer

Actually you don't need 

    <xpath expr="/form/group/group[2]/field[1][@name='description']" position="replace">
           <label for="description" string="ID"/>

you just need

<label for="description" position="replace">
                    <label for="description"  string="ID"/>
                </label>

Avatar
Discard