Skip to content
Snippets Groups Projects
Commit e84b569f authored by Martin Trigaux's avatar Martin Trigaux
Browse files

[FIX] mrp_operation: missing context

It is present in mrp declaration but was not in mrp_production which was problematic if another module inherit as well from action_produce_end.
parent 6fe2723e
Branches
Tags
No related merge requests found
......@@ -207,17 +207,17 @@ class mrp_production(osv.osv):
result[prod.id] = max(line.date_planned_end, result[prod.id])
return result
def action_production_end(self, cr, uid, ids):
def action_production_end(self, cr, uid, ids, context=None):
""" Finishes work order if production order is done.
@return: Super method
"""
obj = self.browse(cr, uid, ids)[0]
obj = self.browse(cr, uid, ids, context=context)[0]
workcenter_pool = self.pool.get('mrp.production.workcenter.line')
for workcenter_line in obj.workcenter_lines:
if workcenter_line.state == 'draft':
workcenter_line.signal_workflow('button_start_working')
workcenter_line.signal_workflow('button_done')
return super(mrp_production,self).action_production_end(cr, uid, ids)
return super(mrp_production,self).action_production_end(cr, uid, ids, context=context)
def action_in_production(self, cr, uid, ids):
""" Changes state to In Production and writes starting date.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment