From fb35132bc655748e8f16fec9540732aecf5bab54 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 6 Mar 2017 10:46:49 +0100 Subject: [PATCH] [FIX] sale_stock: incorrect `return` - Create a SO with both 'service' and 'consu' products - Depending on the order of the lines, the 'Delivered qty' might not be editable consistently. This is because of an incorrect `return` statement in the `_compute_qty_delivered_updateable` method. opw-710561 --- addons/sale_stock/sale_stock.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/sale_stock/sale_stock.py b/addons/sale_stock/sale_stock.py index 0e4fe11a395..63f03f4a64f 100644 --- a/addons/sale_stock/sale_stock.py +++ b/addons/sale_stock/sale_stock.py @@ -121,8 +121,9 @@ class SaleOrderLine(models.Model): def _compute_qty_delivered_updateable(self): for line in self: if line.product_id.type not in ('consu', 'product'): - return super(SaleOrderLine, self)._compute_qty_delivered_updateable() - line.qty_delivered_updateable = False + super(SaleOrderLine, line)._compute_qty_delivered_updateable() + else: + line.qty_delivered_updateable = False @api.onchange('product_id') def _onchange_product_id_set_customer_lead(self):