Odoo Help

1

0
2 Answers
0
Avatar

Koffi KPONOUGLO

--Koffi KPONOUGLO--

834
| 5 4 9
Lomé, توغو
--Koffi KPONOUGLO--

Koffi KPONOUGLO

Koffi KPONOUGLO
17‏/7‏/2014 11:31 ص

Hi Stefan,

See these codes :

class product_template(osv.osv):
    _name = "product.template"
    _inherit = ['mail.thread']
    _description = "Product Template"

class product_product(osv.osv):
    _name = "product.product"
    _description = "Product"
    _inherits = {'product.template': 'product_tmpl_id'}
    _inherit = ['mail.thread']
    _order = 'default_code,name_template'

product.product inherits product.template so you should add you new field in product.product. Your new field will available to both.

 

 

 

1
Walid Baruni
18‏/7‏/2014 10:20 ص

The main difference between product.product and product.template is when you use product variants.

  • If you add a field to product.template (template), then the field value will be shared to all variants (product.product) of that template.
  • If you add a field to product.product (variant), then the field value will be different in each variant of the same template (product.template)

If you don't use product variants, then I belive its better to add the field to product.product

Ask a Question
Writer
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now