diff --git a/addons/sale_stock/models/sale_order.py b/addons/sale_stock/models/sale_order.py index 06f1ef715ba..64d4398cba1 100644 --- a/addons/sale_stock/models/sale_order.py +++ b/addons/sale_stock/models/sale_order.py @@ -109,13 +109,9 @@ class SaleOrderLine(models.Model): @api.multi @api.depends('product_id') def _compute_qty_delivered_updateable(self): - # prefetch field before filtering - self.mapped('product_id') - # on consumable or stockable products, qty_delivered_updateable defaults - # to False; on other lines use the original computation - lines = self.filtered(lambda line: line.product_id.type not in ('consu', 'product')) - lines = lines.with_prefetch(self._prefetch) - super(SaleOrderLine, lines)._compute_qty_delivered_updateable() + for line in self: + if line.product_id.type not in ('consu', 'product'): + super(SaleOrderLine, line)._compute_qty_delivered_updateable() @api.onchange('product_id') def _onchange_product_id_set_customer_lead(self):