I have a custom field in product.template. I want to pass that value to product.product.
Normally product type, internal reference are passed to product.product
1.How is that work in base code?
2.How to my custom field to product.product.?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I have a custom field in product.template. I want to pass that value to product.product.
Normally product type, internal reference are passed to product.product
1.How is that work in base code?
2.How to my custom field to product.product.?
Product.product is inherits from product.template, so any filed in product.template will automatically passed to product.product by framework
2- So to custom field in product.product you can inherit product.product or product.template and add your new field
Thanks Mahmoud
If you need to access a custom field value of product.template, from product.product, you can do it easily.
Just browse the product.product record and use the product_tmpl_id field to get the custom field value from product.template table. i.e, like,
for product in self.env['product.product'].search([]):
print "custom_field value =', product.product_tmpl_id.custom_field
Thanks Linto
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
May 17
|
3385 | ||
|
2
Aug 23
|
1972 | ||
|
0
Oct 21
|
1013 | ||
|
1
Sep 19
|
3918 | ||
|
2
Jan 24
|
15975 |