0
votes

I want to add some custom attributes to the field label of xml, such as:

 <group>
   field name="a" custom="value"/>
 </group>

custom="value" is my custom label.

But it seems that odoo will erase the label it can not recognise.

How to add it?

3
I want it to be converted to: <td data-field="hello-field" class="hello-class" custom="value">hello world</td>Don_Chen

3 Answers

1
votes

Try with string attribute of field tag.

For example:

<field name="a" string="Custom Label">

All attributes of field tag.

0
votes

For add a label in xml file :

<label for="a"/>

But for displaying "Custom Label", modifie in python file :

'a': fields.char('Custom Label', size=64, required=True),
0
votes

You can use label tag, like this

<label for='a' string='custom label'></label>

<field name="a"/>

This will work.