如何在Odoo 12中显示复选框?

时间:2019-12-17 05:33:45

标签: checkbox module odoo odoo-12

我想在Odoo 12中显示复选框。我尝试使用我的代码,但是它不起作用,请帮助我。 这是我的模块代码。

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

这是查看代码:

   <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>

1 个答案:

答案 0 :(得分:1)

让我尝试一下:

您的外部ID应该是:

<field name="inherit_id" ref="product.product_template_only_form_view"/>
相关问题