Skip to Content
Menu
This question has been flagged
2 Replies
6763 Views

Guys, what is the difference between

product_id = fields.Many2one('product.template')

and

product_id = fields.Many2one('product.product')

If I'm using to read data 'product.template' getting different information than if I'm reading from database using 'product.product'

With 'product.product' everything seems to be OK/correct, when I'm using 'product.template' everything is completely wrong.

It shouldn't be the same ?


Just asking :)

Avatar
Discard
Best Answer

No it is not same because product template is one product and product.product is variants of that perticular product template let understand with one example suppose you are selling POLO T-shirt polo t-shirt are in different color so you can define that different color in product.product.

Avatar
Discard
Author

Whatever, the most important thing is I have to read data using product.product instead of product template :) I was using product.template first and everything was wrong, all information I read from database was incorrect, weird names (completely different, mixed up), quants ok but system was applying wrong names to the ID's :) Anyway, thank you, now I know what to do ;)

Best Answer

product_template class is the base class for product_product. Same as 'resource_resource' is a base class and hr_employee inherited from it. So dealing with product_product will not be the same as product_template. 

Avatar
Discard