diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index df5456baa4a..668b69c6fcc 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -244,15 +244,17 @@ class mrp_production(osv.osv): wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_start_working', cr) return super(mrp_production,self).action_in_production(cr, uid, ids) - def action_cancel(self, cr, uid, ids): + def action_cancel(self, cr, uid, ids,context=None): """ Cancels work order if production order is canceled. @return: Super method """ - obj = self.browse(cr, uid, ids)[0] + if context is None: + context = {} + obj = self.browse(cr, uid, ids,context)[0] wf_service = netsvc.LocalService("workflow") for workcenter_line in obj.workcenter_lines: wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_cancel', cr) - return super(mrp_production,self).action_cancel(cr,uid,ids) + return super(mrp_production,self).action_cancel(cr,uid,ids,context) def _compute_planned_workcenter(self, cr, uid, ids, context=None, mini=False): """ Computes planned and finished dates for work order.