From 89af2f0c8e1fe2b8154dbae862c824ad285d3663 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 8 Nov 2010 11:44:12 +0100 Subject: [PATCH] [FIX] Do not raise an error if the next todo isn't found to set the previous todo's status The previous line hardly makes any sense, so clarification: finding the 'next' todo is based on todo states, so until we've set the state of the todo item we've just executed (aka the previous todo) it remains the 'next' todo as well. So in order to set the previous todo's state, we look for the next todo (which it still is) and set its state, actually marking it as the 'previous' todo bzr revid: xmo@openerp.com-20101108104412-bd7bf3k7c5p5jkpl --- bin/addons/base/res/res_config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/addons/base/res/res_config.py b/bin/addons/base/res/res_config.py index f4aee874839..b5956b14a4e 100644 --- a/bin/addons/base/res/res_config.py +++ b/bin/addons/base/res/res_config.py @@ -95,7 +95,8 @@ class res_config_configurable(osv.osv_memory): # "previous" todo previous_todo = self._next_action(cr, uid, context=context) if not previous_todo: - raise LookupError(_("Couldn't find previous ir.actions.todo")) + self.__logger.warn(_("Couldn't find previous ir.actions.todo")) + return if not state: raise ValueError(_("Can't set an ir.actions.todo's state to an empty value.")) previous_todo.write({'state':state})