[FIX] stock: To avoid singleton error

Execute on a single record is used when calling the function
_update_line_quantity and avoid singleton error

Closes #23860
This commit is contained in:
Florent de Labarre
2018-04-05 14:48:53 +02:00
committed by Martin Trigaux
parent 115b9616c1
commit f8ade1c96d
+2 -2
View File
@@ -343,8 +343,8 @@ class SaleOrderLine(models.Model):
raise UserError('You cannot decrease the ordered quantity below the delivered quantity.\n'
'Create a return first.')
for line in self:
pickings = self.order_id.picking_ids.filtered(lambda p: p.state not in ('done', 'cancel'))
pickings = line.order_id.picking_ids.filtered(lambda p: p.state not in ('done', 'cancel'))
for picking in pickings:
picking.message_post("The quantity of %s has been updated from %d to %d in %s" %
(line.product_id.name, line.product_uom_qty, values['product_uom_qty'], self.order_id.name))
(line.product_id.name, line.product_uom_qty, values['product_uom_qty'], line.order_id.name))
super(SaleOrderLine, self)._update_line_quantity(values)