From ad9dc537a80a452807e4c0da60a2322a444ebfac Mon Sep 17 00:00:00 2001 From: Sarah Bellefroid Date: Tue, 27 Feb 2024 09:50:56 +0100 Subject: [PATCH] [FIX] sale: remove redundant code This is a fixup of: https://github.com/odoo/odoo/pull/149155 Warning is duplicated: https://github.com/odoo/odoo/blob/8ccde3f101cdb6ca41fe29cc5b4252f13745774a/addons/sale/models/sale_order_line.py#L1223-L1232 In the case where some products are already added to the SO before selecting the catalog, the warning props will always be loaded. However, since the warning props is a String but sale_line_warn can be false, it only need no be added if sale_line_warn is set. opw-3631511 closes odoo/odoo#155523 Signed-off-by: Sarah Bellefroid (sbel) --- addons/sale/models/sale_order_line.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/sale/models/sale_order_line.py b/addons/sale/models/sale_order_line.py index 74934dd11cf..f3530107460 100644 --- a/addons/sale/models/sale_order_line.py +++ b/addons/sale/models/sale_order_line.py @@ -1219,7 +1219,6 @@ class SaleOrderLine(models.Model): 'quantity': self.product_uom_qty, 'price': self.price_unit, 'readOnly': self.order_id._is_readonly() or (self.product_id.sale_line_warn == "block"), - 'warning': self.product_id.sale_line_warn_msg, } if self.product_id.sale_line_warn_msg: res['warning'] = self.product_id.sale_line_warn_msg