2

How to display and align the label of a field on a form in OpenERP?

 3 years ago
source link: https://www.codesd.com/item/how-to-display-and-align-the-label-of-a-field-on-a-form-in-openerp.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How to display and align the label of a field on a form in OpenERP?

advertisements

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:

xkfIZ.jpg

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>


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>


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK