diff --git a/addons/product/models/product.py b/addons/product/models/product.py index 8e63236e48d..51c826499a1 100644 --- a/addons/product/models/product.py +++ b/addons/product/models/product.py @@ -595,10 +595,11 @@ class SupplierInfo(models.Model): date_end = fields.Date('End Date', help="End date for this vendor price") product_id = fields.Many2one( 'product.product', 'Product Variant', - help="When this field is filled in, the vendor data will only apply to the variant.") + help="If not set, the vendor price will apply to all variants of this products.") product_tmpl_id = fields.Many2one( 'product.template', 'Product Template', index=True, ondelete='cascade', oldname='product_id') + product_variant_count = fields.Integer('Variant Count', related='product_tmpl_id.product_variant_count') delay = fields.Integer( 'Delivery Lead Time', default=1, required=True, help="Lead time in days between the confirmation of the purchase order and the receipt of the products in your warehouse. Used by the scheduler for automatic computation of the purchase order planning.") diff --git a/addons/product/models/product_template.py b/addons/product/models/product_template.py index af1cf89c871..1d36d506e75 100644 --- a/addons/product/models/product_template.py +++ b/addons/product/models/product_template.py @@ -78,7 +78,7 @@ class ProductTemplate(models.Model): 'Cost', compute='_compute_standard_price', inverse='_set_standard_price', search='_search_standard_price', digits=dp.get_precision('Product Price'), groups="base.group_user", - help="Cost of the product, in the default unit of measure of the product.") + help="The cost price is used to valuate your inventory.") volume = fields.Float( 'Volume', compute='_compute_volume', inverse='_set_volume', @@ -110,6 +110,7 @@ class ProductTemplate(models.Model): 'product.packaging', string="Product Packages", compute="_compute_packaging_ids", inverse="_set_packaging_ids", help="Gives the different ways to package the same product.") seller_ids = fields.One2many('product.supplierinfo', 'product_tmpl_id', 'Vendors') + variant_seller_ids = fields.One2many('product.supplierinfo', 'product_tmpl_id') active = fields.Boolean('Active', default=True, help="If unchecked, it will allow you to hide the product without removing it.") color = fields.Integer('Color Index') diff --git a/addons/product/views/product_views.xml b/addons/product/views/product_views.xml index 2872a7bfd61..80d25e411d7 100644 --- a/addons/product/views/product_views.xml +++ b/addons/product/views/product_views.xml @@ -48,8 +48,8 @@ -