[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) <sbel@odoo.com>
This commit is contained in:
Sarah Bellefroid
2024-02-28 19:49:06 +00:00
parent 95a9cd2a46
commit ad9dc537a8
-1
View File
@@ -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