Muhammad Imran Sarwar
Muhammad Imran Sarwar

Reputation: 21

How can i show checkbox in Odoo 12?

I want to show checkbox in Odoo 12. I try with my code but it's not working Please help me. Here is my code of module.

class ProductTemplate(models.Model):
    _inherit = 'product.template'
    field_name1 = fields.Boolean(string="Product Barcode Generator")

Here is view Code:

   <record id="product_template_form_parent_inherit" model="ir.ui.view">
        <field name="name">product.template.form.parent.inherit</field>
        <field name="model">product.template</field>
        <field name="inherit_id" ref="product.product_template_form_view"/>
        <field name="arch" type="xml">
            <xpath expr="//notebook" position="inside">
                <page string="Product Barcode Generator">
                    <label for="field_name1"/>
                    <field name="field_name1" />
                </page>
            </xpath>
        </field>
    </record>

Upvotes: 1

Views: 517

Answers (1)

Adam Strauss
Adam Strauss

Reputation: 1999

Let me try:

Your External Id should be:

<field name="inherit_id" ref="product.product_template_only_form_view"/>

Upvotes: 1

Related Questions