From acffe8c5e234e98fd59523a88474aeb949d7db49 Mon Sep 17 00:00:00 2001 From: Jordi Ballester Date: Wed, 2 Feb 2022 22:53:30 +0100 Subject: [PATCH] [fix] rma: when using 2 step receipt or delivery, don't count double --- rma/models/rma_order_line.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rma/models/rma_order_line.py b/rma/models/rma_order_line.py index 1cc7753d..de982874 100644 --- a/rma/models/rma_order_line.py +++ b/rma/models/rma_order_line.py @@ -75,6 +75,11 @@ class RmaOrderLine(models.Model): for move in rec.move_ids.filtered( 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) return qty