[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
This commit is contained in:
David
2023-03-21 13:54:44 +01:00
committed by Víctor Martínez
parent 80d8a2696b
commit 4eb228800d
2 changed files with 4 additions and 1 deletions

View File

@@ -3,7 +3,7 @@
{ {
"name": "Return Merchandise Authorization Management", "name": "Return Merchandise Authorization Management",
"summary": "Return Merchandise Authorization (RMA)", "summary": "Return Merchandise Authorization (RMA)",
"version": "15.0.1.1.2", "version": "15.0.1.1.3",
"development_status": "Production/Stable", "development_status": "Production/Stable",
"category": "RMA", "category": "RMA",
"website": "https://github.com/OCA/rma", "website": "https://github.com/OCA/rma",

View File

@@ -20,6 +20,9 @@ class ReturnPicking(models.TransientModel):
[("company_id", "=", self.picking_id.company_id.id)] [("company_id", "=", self.picking_id.company_id.id)]
).mapped("rma_loc_id") ).mapped("rma_loc_id")
rma_loc_domain = [("id", "child_of", rma_loc.ids)] 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: else:
# If self.create_rma is not True, the value of the location and # If self.create_rma is not True, the value of the location and
# the location domain will be the same as assigned by default. # the location domain will be the same as assigned by default.