Odoo Help

Welcome!

This community 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.

0

Product vs Template [SOLVED]

By
Dr Obx
on 12/24/15, 7:22 AM 637 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 :)

2

Tarek Mohamed Ibrahim

--Tarek Mohamed Ibrahim--
896
| 5 3 7
Gîza, Egypt
--Tarek Mohamed Ibrahim--

I am an old VFP developer on ERP

I have moved to 2p since Nov-2014 and started developing with Python on Odoo.

https://www.linkedin.com/profile/public-profile-settings?trk=prof-edit-edit-public_profile

tibrahim@2p.com.sa

Tarek Mohamed Ibrahim
On 12/24/15, 7:34 AM

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. 

2
Krupesh Laiya
On 12/24/15, 7:28 AM

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.

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 ;)

Dr Obx
on 12/29/15, 4:23 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/24/15, 7:22 AM
Seen: 637 times
Last updated: 12/25/15, 5:35 PM