From 5a3fab10cfae71a62ac038e47055c3ffd6c9f482 Mon Sep 17 00:00:00 2001 From: Nicolas Delbovier Date: Thu, 30 Apr 2026 16:44:39 +0200 Subject: [PATCH 1/3] [IMP] rma_repair: do not copy repair_id when duplicating --- rma_repair/models/rma.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rma_repair/models/rma.py b/rma_repair/models/rma.py index 0de387544..4aab6b2e9 100644 --- a/rma_repair/models/rma.py +++ b/rma_repair/models/rma.py @@ -7,7 +7,7 @@ class RMA(models.Model): _inherit = "rma" - repair_id = fields.Many2one("repair.order") + repair_id = fields.Many2one("repair.order", copy=False) can_be_repaired = fields.Boolean(compute="_compute_can_be_repaired") @api.depends("repair_id", "state", "operation_id.action_create_repair") From 46fe48b99c6155356d7a698c7c4804eac03cd556 Mon Sep 17 00:00:00 2001 From: Nicolas Delbovier Date: Thu, 30 Apr 2026 16:47:35 +0200 Subject: [PATCH 2/3] [FIX] rma_repair: prevent automatic assignment of responsible on repair The `repair.order` model defaults `user_id` to the current user. Since RMA processing and technical repairs could be handled by different teams, automatically assigning the customer service agent to the repair order is incorrect. --- rma_repair/models/rma.py | 7 +++++-- rma_repair/tests/test_rma_repair_order.py | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/rma_repair/models/rma.py b/rma_repair/models/rma.py index 4aab6b2e9..cad0db82b 100644 --- a/rma_repair/models/rma.py +++ b/rma_repair/models/rma.py @@ -69,6 +69,7 @@ def _get_repair_order_default_vals(self): "default_address_id": self.partner_shipping_id.id, "default_partner_invoice_id": self.partner_invoice_id.id, "default_picking_id": self.reception_move_id.picking_id.id, + "default_user_id": False, } if self.lot_id: vals["default_lot_id"] = self.lot_id.id @@ -97,12 +98,14 @@ def _create_repair(self): self.ensure_one() if self.repair_id: return self.repair_id - return ( + repair = ( self.env["repair.order"] .with_context(**self._get_repair_order_default_vals()) - .create({}) + .create({"user_id": False}) ) + return repair + def action_confirm(self): res = super().action_confirm() for rec in self: diff --git a/rma_repair/tests/test_rma_repair_order.py b/rma_repair/tests/test_rma_repair_order.py index f69aa47d6..958306c6e 100644 --- a/rma_repair/tests/test_rma_repair_order.py +++ b/rma_repair/tests/test_rma_repair_order.py @@ -60,6 +60,7 @@ def test_action_create_repair_order(self): "default_address_id": self.rma.partner_shipping_id.id, "default_partner_invoice_id": self.rma.partner_invoice_id.id, "default_picking_id": self.rma.reception_move_id.picking_id.id, + "default_user_id": False, } for key, expected_value in expected.items(): self.assertIn(key, ctx, f"Missing context key: {key}") @@ -179,3 +180,18 @@ def test_automatically_create_repair_after_receipt(self): self.assertFalse(self.rma_without_repair.can_be_repaired) self.assertTrue(self.rma_without_repair.repair_id) self.assertFalse(self.rma_without_repair.can_be_repaired) + + def test_rma_repair_no_defualt_user_id(self): + """ + Ensure repair order create from RMA is not assigned a responsible. + + Rationale: + The customer service agent confirming the RMA is often not + part of the technical repair team. Automatically assigning the RMA + validator as the repair responsible would create unwanted notifications. + """ + rma = self.rma.copy() + rma.operation_id.action_create_repair = "automatic_on_confirm" + rma.action_confirm() + self.assertTrue(rma.repair_id) + self.assertFalse(rma.repair_id.user_id) From 5976ab4e35e162064b4cbed0b53250aadc14068b Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 5 May 2026 06:13:14 +0000 Subject: [PATCH 3/3] [BOT] post-merge updates --- README.md | 2 +- rma_repair/README.rst | 2 +- rma_repair/__manifest__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c6cdb9526..12344f394 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ addon | version | maintainers | summary [rma_lot_autocreate](rma_lot_autocreate/) | 16.0.1.0.0 | sbejaoui | Auto-generate stock lot at RMA confirm using per-operation sequence [rma_procurement_customer](rma_procurement_customer/) | 16.0.1.0.0 | | Rma Procurement Customer [rma_reason](rma_reason/) | 16.0.1.0.1 | sbejaoui | Rma Reason -[rma_repair](rma_repair/) | 16.0.1.0.0 | peluko00 | Create a repair order from rma +[rma_repair](rma_repair/) | 16.0.1.1.0 | peluko00 | Create a repair order from rma [rma_sale](rma_sale/) | 16.0.4.0.2 | pedrobaeza | Sale Order - Return Merchandise Authorization (RMA) [rma_sale_lot](rma_sale_lot/) | 16.0.1.0.0 | | Manage sale returns with lot. [rma_sale_mrp](rma_sale_mrp/) | 16.0.2.2.2 | chienandalu | Allow doing RMAs from MRP kits diff --git a/rma_repair/README.rst b/rma_repair/README.rst index 7ed8d666c..6ef188956 100644 --- a/rma_repair/README.rst +++ b/rma_repair/README.rst @@ -11,7 +11,7 @@ RMA Repair !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:34062beeacf5c1e8b31f6c68ba89ecc7625cc8a2b01d154e397a0fbc7cfc6c99 + !! source digest: sha256:822c9728409407a45117c89311d45c8d32ff27f568ffac2bbf004d31fce6a7ed !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/rma_repair/__manifest__.py b/rma_repair/__manifest__.py index 04ec384c1..d32f66942 100644 --- a/rma_repair/__manifest__.py +++ b/rma_repair/__manifest__.py @@ -3,7 +3,7 @@ { "name": "RMA Repair", "summary": "Create a repair order from rma", - "version": "16.0.1.0.0", + "version": "16.0.1.1.0", "category": "RMA", "website": "https://github.com/OCA/rma", "author": "Antoni Marroig, Odoo Community Association (OCA)",