[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.
This commit is contained in:
Lionel Sausin
2015-02-11 18:58:42 +01:00
committed by Pedro M. Baeza
parent 1200c07ac5
commit cab1b1c47a

View File

@@ -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):