diff --git a/rma_sale_mrp/models/rma.py b/rma_sale_mrp/models/rma.py index 0fbf87b2..2ce607fb 100644 --- a/rma_sale_mrp/models/rma.py +++ b/rma_sale_mrp/models/rma.py @@ -62,3 +62,13 @@ class Rma(models.Model): "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()