In odoo 8.0 product.product and product.template changed.
I want to create a module that adds a new field to the product page.
Should i inherit product.product and add a new field there or is product.template the right place?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
In odoo 8.0 product.product and product.template changed.
I want to create a module that adds a new field to the product page.
Should i inherit product.product and add a new field there or is product.template the right place?
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.
The main difference between product.product and product.template is when you use product variants.
If you don't use product variants, then I belive its better to add the field to product.product
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
0
feb 25
|
1430 | ||
|
0
gen 25
|
1199 | ||
Field service upgrade
Risolto
|
|
1
dic 24
|
1567 | |
|
2
giu 23
|
2691 | ||
|
1
giu 22
|
5723 |