[IMP] sale_stock: expense policy should not impact delivered qty on SOL
When making a SO with a stockable product with an expense policy set, confirming the SO will increase the delivered quantity according to the validated picking. But when unlocking and modifying the ordered quantity on picking the delivered quantity on SO does not change (it is if the product have no expense policy). So the expense policy influence the flow in a way (update validated picking) but not on the the other (confirm SO) to compute SO line delivered quantity. This commits make the expense policy not relevent when modifying ordered quantity on picking. It also prepare the cleaning to unify API of delivered quantity computation on SO line for stock and service.
This commit is contained in:
@@ -38,7 +38,7 @@ class StockMove(models.Model):
|
||||
if 'product_uom_qty' in vals:
|
||||
for move in self:
|
||||
if move.state == 'done':
|
||||
sale_order_lines = self.filtered(lambda move: move.sale_line_id and move.product_id.expense_policy == 'no').mapped('sale_line_id')
|
||||
sale_order_lines = self.filtered(lambda move: move.sale_line_id).mapped('sale_line_id')
|
||||
for line in sale_order_lines:
|
||||
line.qty_delivered = line._get_delivered_qty()
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user