Odoo Help


Supplier Info and Supply Method per product.product, not per product.template? Field inheritance?

on 4/9/13, 6:14 PM 1,886 views

I am working with the two objects product.template and product.product. I am writing a script to (in realtime) create new product.product entries for a certain product.template, much like product_variant_multi can do. However, I need some fields that are defined in product.template to actually be defined in product.product, specifically supply_method in this case.

In addition, I need different suppliers per product.product as well, which is currently implemented on product.template as 'seller_ids': fields.one2many('product.supplierinfo', 'product_id', 'Supplier'),, with product.supplierinfo referencing product.template: 'product_id' : fields.many2one('product.template', 'Product', required=True, ondelete='cascade', select=True),.

So my questions seem to revolve around field inheritance and database design:

  1. Can I _inherit product.product and more or less copy the supply_method definition to it, and trust that the new database column will be used in preference to the one in product.template throughout the system?

  2. Can I _inherit product.supplierinfo and overwrite the field product_id to point to product.product instead of product.template, and then _inherit product.product again to correct the seller_ids definition?

Thanks for the advice.

I'm interested in a solution for the second issue as well; it seems a bit odd to me that supplier-specific information is managed in the product templates, and not in the products themselves. I fiddled around with the database, but no joy. product.template keeps on appearing in the error messages, and I don't know where it comes from. Things seem to work if you don't use variants, so that (in most cases) the product_id and template_id are equal. But if you use templates, it is a different story. Did you find something to sort this out?

Ring Pharma NV, Bart Criel
on 2/26/14, 10:53 AM

About This Community

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 4/9/13, 6:14 PM
Seen: 1886 times
Last updated: 3/16/15, 8:10 AM