[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:
Nicolas Martinelli
2017-03-16 13:15:46 +01:00
parent a873890f28
commit e542b450a3
+2 -1
View File
@@ -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