wizard_id = ids and ids[0] or False
wizard = self.browse(cr, uid, wizard_id, context=context)
res = self.pool.get('ir.actions.act_window').read(cr, uid, wizard.action_id.id, ['name', 'view_type', 'view_mode', 'res_model', 'context', 'views', 'type'], context=context)
- res.update({'target':'new', 'nodestroy': True})
+ res.update(target='new', nodestroy=True, context={'active_action_todo': wizard.id})
return res
def action_open(self, cr, uid, ids, context=None):
# this is ultra brittle, but apart from storing the todo id
# into the res.config view, I'm not sure how to get the
# "previous" todo
- previous_todo = self._next_action(cr, uid, context=context)
+ if context is None:
+ context = {}
+ if context.get('active_action_todo'):
+ previous_todo = self.pool.get('ir.actions.todo').browse(cr, uid, context['active_action_todo'], context=context)
+ else:
+ previous_todo = self._next_action(cr, uid, context=context)
if not previous_todo:
self.__logger.warn(_("Couldn't find previous ir.actions.todo"))
return
'res_model': action.res_model,
'type': action.type,
'target': action.target,
+ 'context': {'active_action_todo': next.id},
}
self.__logger.info('all configuration actions have been executed')