[FIX] sale_stock: duplicate qty
- Create a stockable product, create a SO selling 1 unit. - Confirm the SO, validate the Picking 1 => delivered qty is 1 - Return Picking 1 and validate Picking 2 => delivered qty is 1 - Return Picking 2 and validate Picking 3 => delivered qty is 2 The delivered quantity should remain 1. opw-715685
This commit is contained in:
@@ -197,7 +197,8 @@ class SaleOrderLine(models.Model):
|
||||
#Note that we don't decrease quantity for customer returns on purpose: these are exeptions that must be treated manually. Indeed,
|
||||
#modifying automatically the delivered quantity may trigger an automatic reinvoicing (refund) of the SO, which is definitively not wanted
|
||||
if move.location_dest_id.usage == "customer":
|
||||
qty += self.env['product.uom']._compute_qty_obj(move.product_uom, move.product_uom_qty, self.product_uom)
|
||||
if not move.origin_returned_move_id:
|
||||
qty += self.env['product.uom']._compute_qty_obj(move.product_uom, move.product_uom_qty, self.product_uom)
|
||||
return qty
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user