From 2864650c0b130cfbe94cbbe06522e647639dcbf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Wed, 12 Feb 2025 13:37:35 +0100 Subject: [PATCH] [FIX] rma: Change remaining_qty_to_done to remaining_qty field The remaining_qty_to_done field was removed in https://github.com/OCA/rma/commit/9cc5bca1532edc9c8de4fd2e0d0a6cb4e0bb8161 --- rma/models/rma.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/rma/models/rma.py b/rma/models/rma.py index 316f125a..41e2d9ee 100644 --- a/rma/models/rma.py +++ b/rma/models/rma.py @@ -306,16 +306,10 @@ class Rma(models.Model): @api.depends("product_uom_qty", "delivered_qty") def _compute_remaining_qty(self): - """Compute 'remaining_qty' and 'remaining_qty_to_done' fields. + """Compute 'remaining_qty' field. remaining_qty: is used to set a default quantity of replacing or returning of product to the customer. - - remaining_qty_to_done: the aim of this field to control when the - RMA cam be set to 'delivered' state. An RMA with - remaining_qty_to_done <= 0 can be set to 'delivery'. It is used - in stock.move._action_done method of stock.move and - rma.extract_quantity. """ for r in self: r.remaining_qty = r.product_uom_qty - r.delivered_qty @@ -380,7 +374,7 @@ class Rma(models.Model): for r in self: if r.product_uom_qty > 1 and ( (r.state == "waiting_return" and r.remaining_qty > 0) - or (r.state == "waiting_replacement" and r.remaining_qty_to_done > 0) + or (r.state == "waiting_replacement" and r.remaining_qty > 0) ): r.can_be_split = True else: