Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Inheritance 为什么继承字段没有显示在Odoo 12中?_Inheritance_Barcode_Odoo 12 - Fatal编程技术网

Inheritance 为什么继承字段没有显示在Odoo 12中?

Inheritance 为什么继承字段没有显示在Odoo 12中?,inheritance,barcode,odoo-12,Inheritance,Barcode,Odoo 12,我正试图继承销售模块产品部分新选项卡下的文件。我尝试和代码工作良好,但它只是显示标签,而不是显示该标签下的文件。让我和你分享我的代码。请帮我找到我失踪的地方 这是我的模块代码 class ProductTemplate (models.Model): _inherit = 'product.template' field_name1 = fields.Char (string = "label for the field") 这是我的查看代码 <record id =

我正试图继承销售模块产品部分新选项卡下的文件。我尝试和代码工作良好,但它只是显示标签,而不是显示该标签下的文件。让我和你分享我的代码。请帮我找到我失踪的地方

这是我的模块代码

class ProductTemplate (models.Model): 
    _inherit = 'product.template' 
    field_name1 = fields.Char (string = "label for the field")
这是我的查看代码

<record id = "product_template_sale" model = "ir.ui.view">
    <field name = "name"> product.tamplate.tab </field> 
    <field name = "model"> product.template </field> 
    < field name = "inherit_id" ref = "product.product_template_only_form_view" /> 
    <field name = "arch" type = "xml"> 
        <notebook> 
            <page string = "Barcode"> 
                 <filed name = "field_name1" /> 
            </ page> 
        </notebook> 
    </field> 
</record>

product.tamplate.tab
产品模板
有显示新的标签条形码,我想开发,但文件没有显示在那里。
为什么不显示以及我做错了什么请帮助我找到它。

创建新选项卡时,如果要在该选项卡中添加字段,则必须将该字段包括在组中

您的.py文件是最新的,但需要对.xml文件做一些小的更改

<record id = "product_template_sale" model = "ir.ui.view">
<field name = "name"> product.tamplate.tab </field> 
<field name = "model"> product.template </field> 
<field name = "inherit_id" ref = "product.product_template_only_form_view" /> 
<field name = "arch" type = "xml"> 
 <notebook>
    <page string="Barcode">
        <group name= "barcode_group">
            <field name="field_name1"/>
        </group>  
    </page>
 </notebook>
</field> 

product.tamplate.tab
产品模板

在创建新选项卡及其内部时,如果要在该选项卡中添加字段,则必须将该字段包括在组中

您的.py文件是最新的,但需要对.xml文件做一些小的更改

<record id = "product_template_sale" model = "ir.ui.view">
<field name = "name"> product.tamplate.tab </field> 
<field name = "model"> product.template </field> 
<field name = "inherit_id" ref = "product.product_template_only_form_view" /> 
<field name = "arch" type = "xml"> 
 <notebook>
    <page string="Barcode">
        <group name= "barcode_group">
            <field name="field_name1"/>
        </group>  
    </page>
 </notebook>
</field> 

product.tamplate.tab
产品模板

检查拼写是否错误检查拼写是否错误