0
votes

I try to implement a new tab in product but whenIi insert my add on, it change all the Inherited View in User Interface View.

The product.template.product.form become product.template.clicshopping !!

I am a newbie on Odoo, An help will be appreciated. I don't find where my error

Thank you

my __openerp__.py

'data': [
         'security/ir.model.access.csv',
         'product_clicshopping_view.xml',
],

my 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

my 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 "),
    }

my 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

1 Answers

1
votes

1./ Actually here you have overridden the original view by "product.product_template_form_view" which is causing the problem,instead you should inherit that view. Try to look for the examples where it shows how to inherit the views. You can search for "inherit_id" in the xml files, which will help you to find those examples.

2./ Also in the '.py' file you have commented the '_inherit' line, you should keep that open other wise you will be defining a new 'product.template' model. Uncomment that line and keep it.