Shortcut does not appear in Odoo-9

I created a boolean field. A boolean is shown, but no label.

class product_pricelist_inherit(models.Model): _inherit = 'product.pricelist' myfield= fields.Boolean(string="Is this Pricelist Eligible for Me?") 

XML:

 <odoo> <record id="product_product_pricelist_view" model="ir.ui.view"> <field name="model">product.pricelist</field> <field name="inherit_id" ref="product.product_pricelist_view"/> <field name="arch" type="xml"> <field name="name" position="after"> <field name="myfield"/> </field> </field> </record> </odoo> 
+5
source share
3 answers

It will not show your field label because you added the field to the <div>

Try the following code.

Replace

 <field name="myfield"/> 

with

 <label for="myfield"/> <field name="myfield"/> 
+4
source

You can use group to display the field label:

 <group> <field name="myfield"/> </group> 

There is group right after the name field, this can be done using xpath :

 <xpath expr="//group" position="inside"> <field name="myfield"/> </xpath> 

In the first example, you can use position="before"

+2
source

You need to place your field inside the group:

  <field name="arch" type="xml"> <group name="example_group" position="inside"> <field name="your_field" /> </group> </field> 
0
source

All Articles