mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[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:
committed by
Pedro M. Baeza
parent
1200c07ac5
commit
cab1b1c47a
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user