Files
rma/rma/wizard/rma_finalization_wizard.py
david 6748c733f7 [IMP] rma: finish RMA manually
Sometimes there's no choice to return, refund or replace an RMA for
different reasons. For example, when the customer doesn't want to repair
the product because that would be too expensive. We still want finish
the RMA and document the reasons. This improvement allows it.

TT34164
2024-05-03 13:08:24 +02:00

19 lines
630 B
Python

# Copyright 2022 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models
class RmaFinalizationWizard(models.TransientModel):
_name = "rma.finalization.wizard"
_description = "RMA Finalization Wizard"
finalization_id = fields.Many2one(
comodel_name="rma.finalization", string="Reason", required=True
)
def action_finish(self):
self.ensure_one()
rma_ids = self.env.context.get("active_ids")
rma = self.env["rma"].browse(rma_ids)
rma.write({"finalization_id": self.finalization_id, "state": "finished"})