mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[FIX] rma_sale_mrp: avoid reopening of kit RMAs
As we rely on the kit_qty field have the kit/component relation an that's computed when the RMA is created, we want to avoid reopening the RMA to avoid inconsitencies. The user should create a new RMA. TT41943
This commit is contained in:
@@ -62,3 +62,13 @@ class Rma(models.Model):
|
|||||||
"state": "refunded",
|
"state": "refunded",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def action_draft(self):
|
||||||
|
if self.filtered(lambda r: r.state == "cancelled" and r.phantom_bom_product):
|
||||||
|
raise UserError(
|
||||||
|
_(
|
||||||
|
"To avoid kit quantities inconsistencies it is not possible to convert "
|
||||||
|
"to draft a cancelled RMA. You should do a new one from the sales order."
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return super().action_draft()
|
||||||
|
|||||||
Reference in New Issue
Block a user