From d2c6a1ef54119d67e2e68a31bdcfe8ccf9ef4b53 Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Wed, 27 Apr 2011 14:34:15 +0530 Subject: [PATCH] [IMP]: res_config: Wizards that directly opens a form stays in Todo state even if its called, as next_action is not called, so, setting state as done 'manually' bzr revid: rpa@tinyerp.com-20110427090415-ktbd3xvid9pbwn1c --- openerp/addons/base/res/res_config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openerp/addons/base/res/res_config.py b/openerp/addons/base/res/res_config.py index 75e42ef9bdc..efd1fc9ea17 100644 --- a/openerp/addons/base/res/res_config.py +++ b/openerp/addons/base/res/res_config.py @@ -77,7 +77,12 @@ class res_config_configurable(osv.osv_memory): cr.execute("select 1 from res_groups_users_rel where uid=%s and gid IN %s",(uid, tuple(todo_groups),)) dont_skip_todo = bool(cr.fetchone()) if dont_skip_todo: - return todos.browse(cr, uid, active_todos[0], context=None) + res = todos.browse(cr, uid, active_todos[0], context=None) + # Wizards that directly opens a form stays in Todo state even if its called, + # as next_action is not called, so, setting state as done 'manually' + if res.action_id.target == 'current': + res.write({'state': 'done'}) + return res else: todos.write(cr, uid, active_todos[0], {'state':'skip'}, context=None) return self._next_action(cr, uid)