Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I've made a custom field in product.template to select a product quality, based on a Many2one relationship with qualities.
qualities_id = field.Many2one(comodel_name="qualities", string="quality")
In the class: qualities there is a One2Many relationship with the class: quality.supplier.
reseller_ids = fields.One2many('supplierinfo', 'product_qual_id', 'Supplier')
Here we can select a quality type e.g. ( id=16 type=B321 ). This quality type (16) can have more then one supplier. So in supplierinfo we have the field product_qual_id (id = 16) that holds multi suppliers (id = 24, 25, 26)
product_qual_id = fields.Many2one('qualities', 'Quality Template')
Supplierinfo holds suppliers and each supplier holds more then one quantity and price. There is a relationship between supplierinfo and supplier prices using the field suppinfo_id.
pricelist_ids = fields.One2many('supplierprice', 'suppinfo_id', 'Supplier Price')
Because of this relationship, supplierprice: suppinfo, holds more then one quantity and corresponding price based on supplierinfo_id. Field that holds these records:
suppinfo_id = fields.Many2one('supplierinfo', 'Supplier information')
Qualities = ( id=16 type=B321 ). This quality type (16) can have more then one supplier. So in supplierinfo we have the field product_qual_id (id = 16) that holds multi suppliers (id = 24, 25, 26) where Record id: 24 in relation to supplierprice has multi qty and prices:
- supplierprice id=30 supplierinfo id=24 qty=200, price=285
- supplierprice id=31 supplierinfo id=24 qty=300, price=265
- supplierprice id=32 supplierinfo id=24 qty=500, price=248
With additional automation, I need the price from supplierprice, based on (less or more) quantity in the main product. (product.template, price). Can anyone push me in the right direction. How can I get the price from supplierprice into a (new) field in my product.template?
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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 2/11/16, 5:34 AM|
|Seen: 592 times|
|Last updated: 2/11/16, 9:58 AM|