From fafb0ed8c53def2c8e3022a861c09a7b2d7c8529 Mon Sep 17 00:00:00 2001 From: amoyaux Date: Fri, 11 Aug 2017 13:50:11 +0200 Subject: [PATCH] [IMP] mrp : Improve error message on cancel MO with consumed qty Adding the step to do when the user want to delete the MO. --- addons/mrp/models/stock_move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mrp/models/stock_move.py b/addons/mrp/models/stock_move.py index 43ef948a626..40098f5f16e 100644 --- a/addons/mrp/models/stock_move.py +++ b/addons/mrp/models/stock_move.py @@ -88,7 +88,8 @@ class StockMove(models.Model): @api.multi def action_cancel(self): if any(move.quantity_done for move in self): #TODO: either put in stock, or check there is a production order related to it - raise exceptions.UserError(_('You cannot cancel a stock move having already consumed material')) + raise exceptions.UserError(_('You cannot cancel a manufacturing order if you have already consumed material.\ + If you want to cancel this MO, please change the consumed quantities to 0.')) return super(StockMove, self).action_cancel() @api.multi