Odoo Help


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.


Should I create product.template for every product I create through XML-RPC?

Mikko Leppimaa
on 4/6/13, 11:07 AM 3,225 views


I'm writing a python script which will be used to import new products from CSV files via XML-RPC. The script itself does what it's ment to do, but I'm just wondering if I should really create product.template for every product I create through XML-RPC or should I use the same product.template for all created products and update the product.product data separately? (Or overwrite the same product.template over and over again?)

In all the examples I have seen, everyone seems create a new template for every product created through XML-RPC. Is there some specific reason behind this that I'm not aware about?

Isn't creating new product.template for every new product going to increase the database size with garbage data during time of usage?

  • Mikko

Francesco OpenCode

--Francesco OpenCode--
| 5 7 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 4/6/13, 1:35 PM

product.product is an extension of product.template. With this system you can create one template and more product variants. the template_id field in product is a required field to create a product.product record. So you need to create a template and to connect its id in the product.

Thank you for the advice!

If I understood this correctly, lets say for example if I execute sock.execute Read for field 'decription' from product.product, the OpenERP actually retrieves the data from product.template with matching 'product_tmpl_id'? And for writing (updating the 'description' field) vice versa?

Mikko Leppimaa
on 4/7/13, 3:18 PM

Yes. If you write a product.template field in a product.product class, OpenERP writes it automatically in product.template.

Francesco OpenCode
on 4/8/13, 5:18 AM


Mikko Leppimaa
on 4/8/13, 6:58 AM

Please, if you think that my answer is the correct one, mark it as correct so who will search the some answer can see that you solve with it. Thanks

Francesco OpenCode
on 4/8/13, 7:26 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)


Asked: 4/6/13, 11:07 AM
Seen: 3225 times
Last updated: 3/16/15, 8:10 AM