Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Label Not Showing in Odoo-9

I created a boolean field. The boolean is showing but the label isn't.

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>
like image 382
maharshi Avatar asked Aug 26 '16 06:08

maharshi


1 Answers

It will not show your field label because you have added field in <div>

Try with following code.

Replace

<field name="myfield"/>

with

<label for="myfield"/>
<field name="myfield"/>
like image 146
Bhavesh Odedra Avatar answered Sep 21 '22 19:09

Bhavesh Odedra