From caa4ca7cc14c2013e03cf9586e2221cd95daa22f Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 24 Sep 2020 13:10:56 +0000 Subject: [PATCH] [FIX] sale, sale_prodcut_matrix: Default customer Lead Time not set with Order Grid Entry Steps to reproduce the bug: - Let's consider a product P with three variants red, yellow and blue - Let's set a customer lead time on P = 10 days - Set Order Grid Entry on P - Create a quotation Q and add P - In the grid entry matrix add 1 red, 1 yellow and 1 blue Bug: The customer lead time of these three variants were not set on the lines. opw:2337049 closes odoo/odoo#58675 X-original-commit: 0eae213d6c8a656ab2c045995e1f0643ff65df51 Signed-off-by: Simon Goffin (sig) --- addons/sale/models/sale.py | 3 +++ addons/sale_product_matrix/models/sale_order.py | 1 + 2 files changed, 4 insertions(+) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 8a59e4c6136..df14f2a3f3f 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -1713,6 +1713,9 @@ class SaleOrderLine(models.Model): 'tax_id', 'analytic_tag_ids' ] + def _onchange_product_id_set_customer_lead(self): + pass + @api.onchange('product_id', 'price_unit', 'product_uom', 'product_uom_qty', 'tax_id') def _onchange_discount(self): if not (self.product_id and self.product_uom and diff --git a/addons/sale_product_matrix/models/sale_order.py b/addons/sale_product_matrix/models/sale_order.py index f50e35b0498..a504416274c 100644 --- a/addons/sale_product_matrix/models/sale_order.py +++ b/addons/sale_product_matrix/models/sale_order.py @@ -113,6 +113,7 @@ class SaleOrder(models.Model): for line in self.order_line.filtered(lambda line: line.product_template_id == product_template): line.product_id_change() line._onchange_discount() + line._onchange_product_id_set_customer_lead() def _get_matrix(self, product_template):