From cab1b1c47a32ad70382c6929bbaec6d2fcc5f58b Mon Sep 17 00:00:00 2001 From: Lionel Sausin Date: Wed, 11 Feb 2015 18:58:42 +0100 Subject: [PATCH] [FIX] call super before testing the workcenters We check that the production order's workcenter lines contain at least one "Produce here" line", but at this stage they are not created because we didn't call super(). So let's call super() first. --- mrp_operations_extension/models/mrp_production.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mrp_operations_extension/models/mrp_production.py b/mrp_operations_extension/models/mrp_production.py index 8b01aeb15..1ffe02b28 100644 --- a/mrp_operations_extension/models/mrp_production.py +++ b/mrp_operations_extension/models/mrp_production.py @@ -24,11 +24,12 @@ class MrpProduction(models.Model): @api.multi def action_confirm(self): + res = super(MrpProduction, self).action_confirm() if (self.routing_id and not any([x.do_production for x in self.workcenter_lines])): raise exceptions.Warning( _("At least one work order must have checked 'Produce here'")) - return super(MrpProduction, self).action_confirm() + return res @api.multi def _action_compute_lines(self, properties=None):