Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ addon | version | maintainers | summary
[rma_lot_autocreate](rma_lot_autocreate/) | 16.0.1.0.0 | <a href='https://github.com/sbejaoui'><img src='https://github.com/sbejaoui.png' width='32' height='32' style='border-radius:50%;' alt='sbejaoui'/></a> | 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 | <a href='https://github.com/sbejaoui'><img src='https://github.com/sbejaoui.png' width='32' height='32' style='border-radius:50%;' alt='sbejaoui'/></a> | Rma Reason
[rma_repair](rma_repair/) | 16.0.1.0.0 | <a href='https://github.com/peluko00'><img src='https://github.com/peluko00.png' width='32' height='32' style='border-radius:50%;' alt='peluko00'/></a> | Create a repair order from rma
[rma_repair](rma_repair/) | 16.0.1.1.0 | <a href='https://github.com/peluko00'><img src='https://github.com/peluko00.png' width='32' height='32' style='border-radius:50%;' alt='peluko00'/></a> | Create a repair order from rma
[rma_sale](rma_sale/) | 16.0.4.0.2 | <a href='https://github.com/pedrobaeza'><img src='https://github.com/pedrobaeza.png' width='32' height='32' style='border-radius:50%;' alt='pedrobaeza'/></a> | 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 | <a href='https://github.com/chienandalu'><img src='https://github.com/chienandalu.png' width='32' height='32' style='border-radius:50%;' alt='chienandalu'/></a> | Allow doing RMAs from MRP kits
Expand Down
2 changes: 1 addition & 1 deletion rma_repair/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rma_repair/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
9 changes: 6 additions & 3 deletions rma_repair/models/rma.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
16 changes: 16 additions & 0 deletions rma_repair/tests/test_rma_repair_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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)
Loading