[英]Odoo product template implementation new tab
我嘗試在產品中實現一個新選項卡,但是當我插入自己的插件時,它將更改用戶界面視圖中的所有繼承視圖。
product.template.product.form變成product.template.clicshopping!
我是Odoo的新手,我們將為您提供幫助。 我找不到我的錯誤在哪里
謝謝
我的__openerp__.py
'data': [
'security/ir.model.access.csv',
'product_clicshopping_view.xml',
],
我的ir.model.access.csv
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_product_template_clicshopping,product.template clicshopping,product.model_product_template,base.group_sale_manager,1,1,1,1
我的clicshopping.py
from openerp import models, api, fields
class product_clicshopping(models.Model):
_name = 'product_template'
# _inherit = 'product_template'
_columns = {
# 'clicshopping_products_id': fields.integer('Product Id', size=5, help="Id product table of ClicShopping "),
}
我的product_clicshopping_view.xml
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data>
<record model="ir.ui.view" id="product.product_template_form_view">
<field name="name">product.template.clicshopping.form</field>
<!--
<field name="model">product.template</field>
<field name="arch" type="xml">
<notebook>
<page string="ClicShopping">
<group colspan="4">
<field name="clicshopping_product_id"/>
</group>
</page>
</notebook>
</field>
-->
</record>
</data>
</openerp>
1. /實際上,您在此處已用引起問題的“ product.product_template_form_view”覆蓋了原始視圖,而應該繼承該視圖。 嘗試查找示例,其中顯示了如何繼承視圖。 您可以在xml文件中搜索“ inherit_id”,這將幫助您查找這些示例。
2. /同樣,在“ .py”文件中,您已在“ _inherit”行中添加了注釋,否則應保持打開狀態,否則將定義新的“ product.template”模型。 取消注釋該行並保留它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.