diff --git a/rma_sale_mrp/models/rma.py b/rma_sale_mrp/models/rma.py index 741af052..b83a8a93 100644 --- a/rma_sale_mrp/models/rma.py +++ b/rma_sale_mrp/models/rma.py @@ -65,3 +65,13 @@ class Rma(models.Model): } ) return res + + 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()