From 4eb228800d430d141f3a9c398fea50a4a2759cc4 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 21 Mar 2023 13:54:44 +0100 Subject: [PATCH] [FIX] rma: avoid refunding in picking return wizard If we place an RMA from the stock picking return wizard, we want to avoid setting the new moves to refund as that will affect the related sale lines delivered quantities count. TT42021 --- rma/__manifest__.py | 2 +- rma/wizard/stock_picking_return.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/rma/__manifest__.py b/rma/__manifest__.py index e3ff4ba9..0f46d6e6 100644 --- a/rma/__manifest__.py +++ b/rma/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Return Merchandise Authorization Management", "summary": "Return Merchandise Authorization (RMA)", - "version": "15.0.1.1.2", + "version": "15.0.1.1.3", "development_status": "Production/Stable", "category": "RMA", "website": "https://github.com/OCA/rma", diff --git a/rma/wizard/stock_picking_return.py b/rma/wizard/stock_picking_return.py index 78679562..7e16ea6d 100644 --- a/rma/wizard/stock_picking_return.py +++ b/rma/wizard/stock_picking_return.py @@ -20,6 +20,9 @@ class ReturnPicking(models.TransientModel): [("company_id", "=", self.picking_id.company_id.id)] ).mapped("rma_loc_id") rma_loc_domain = [("id", "child_of", rma_loc.ids)] + # We want to avoid setting the return move `to_refund` as it will change + # the delivered quantities in the sale and set them to invoice. + self.product_return_moves.to_refund = False else: # If self.create_rma is not True, the value of the location and # the location domain will be the same as assigned by default.