Reputation: 619
I have a field, in popup window, called "default_code" which correctly displayed the value 201-0147, picture attached. I want to have label "Item Number" just left of the field, on the same line. I tried setting attribute string to the "Item Number" (xml code attached) but it does not display. I know I can use <label>
element, but, when displayed, it's displayed above the field, which I don't want. I want in line with field. What am I missing and what is the way to do it?
Thanks for your help!
Here is the popup window:
Here is the XML code:
<record id="replace_all_in_BOM_form" model="ir.ui.view">
<field name="name">replace.all.in.BOM.form</field>
<field name="model">product.template</field>
<field name="priority" eval="20"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="default_code" string="Item Number" readonly="1"
invisible="0" />
</field>
</record>
Upvotes: 2
Views: 10694
Reputation: 159
Or you can add a label tag like this:
<field name="arch" type="xml">
<label for="default_code" string="Item Number"/>
<field name="default_code" readonly="1"
invisible="0" class="oe_inline"/>
</field>
Upvotes: 3
Reputation: 13382
Fields placed inside a <group>
XML element will display labels by default.
<field name="arch" type="xml">
<group>
<field name="default_code" string="Item Number" readonly="1"
invisible="0" />
</group>
</field>
Upvotes: 5