From bf35164a656771d433912c2d7d2f25e68d381306 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 8 Nov 2010 11:47:18 +0100 Subject: [PATCH] [REM] pre-check that we're not setting ir_actions_todo.state to nothing: it's a selection field, so the write call can check that itself bzr revid: xmo@openerp.com-20101108104718-md2wdklz5rc92ef5 --- bin/addons/base/res/res_config.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/bin/addons/base/res/res_config.py b/bin/addons/base/res/res_config.py index b5956b14a4e..eefef533fb2 100644 --- a/bin/addons/base/res/res_config.py +++ b/bin/addons/base/res/res_config.py @@ -97,8 +97,6 @@ class res_config_configurable(osv.osv_memory): if not previous_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}) def _next(self, cr, uid, context=None): @@ -169,10 +167,7 @@ class res_config_configurable(osv.osv_memory): an action dictionary -- executes the action provided by calling ``next``. """ - try: - self._set_previous_todo(cr, uid, state='done', context=context) - except Exception, e: - raise osv.except_osv(_('Error'), e.message) + self._set_previous_todo(cr, uid, state='done', context=context) next = self.execute(cr, uid, ids, context=None) if next: return next return self.next(cr, uid, ids, context=context) @@ -185,10 +180,7 @@ class res_config_configurable(osv.osv_memory): an action dictionary -- executes the action provided by calling ``next``. """ - try: - self._set_previous_todo(cr, uid, state='skip', context=context) - except Exception, e: - raise osv.except_osv(_('Error'), e.message) + self._set_previous_todo(cr, uid, state='skip', context=context) next = self.cancel(cr, uid, ids, context=None) if next: return next return self.next(cr, uid, ids, context=context) @@ -204,10 +196,7 @@ class res_config_configurable(osv.osv_memory): an action dictionary -- executes the action provided by calling ``next``. """ - try: - self._set_previous_todo(cr, uid, state='cancel', context=context) - except Exception, e: - raise osv.except_osv(_('Error'), e.message) + self._set_previous_todo(cr, uid, state='cancel', context=context) next = self.cancel(cr, uid, ids, context=None) if next: return next return self.next(cr, uid, ids, context=context)