[fix] rma: when using 2 step receipt or delivery, don't count double

This commit is contained in:
Jordi Ballester
2022-02-02 22:53:30 +01:00
parent 813f9097a7
commit acffe8c5e2

View File

@@ -75,6 +75,11 @@ class RmaOrderLine(models.Model):
for move in rec.move_ids.filtered( for move in rec.move_ids.filtered(
lambda m: m.state in states and op(m.location_id.usage, rec.type) lambda m: m.state in states and op(m.location_id.usage, rec.type)
): ):
# If the move is part of a chain don't count it
if direction == "out" and move.move_orig_ids:
continue
elif direction == "in" and move.move_dest_ids:
continue
qty += product_obj._compute_quantity(move.product_uom_qty, rec.uom_id) qty += product_obj._compute_quantity(move.product_uom_qty, rec.uom_id)
return qty return qty