From 266443843e28313e5cf5664d144891aaeabd01ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 9 Dec 2008 16:59:13 +0100 Subject: [PATCH] Catch exception when creating res.user.warning --- tryton/common/common.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tryton/common/common.py b/tryton/common/common.py index b51107224b..62a85b98ac 100644 --- a/tryton/common/common.py +++ b/tryton/common/common.py @@ -754,11 +754,15 @@ def process_exception(exception, parent, obj='', method='', *args): msg = exception.args[3] res = userwarning(str(msg), parent, str(exception.args[2])) if res in ('always', 'ok'): - rpc.execute('object', 'execute', 'res.user.warning', 'create', { - 'user': rpc._USER, - 'name': exception.args[1], - 'always': (res == 'always'), - }, rpc.CONTEXT) + args = ('object', 'execute', 'res.user.warning', 'create', { + 'user': rpc._USER, + 'name': exception.args[1], + 'always': (res == 'always'), + }, rpc.CONTEXT) + try: + rpc.execute(*args) + except Exception, exception: + process_exception(exception, parent, *args) try: return rpc.execute(obj, method, *args) except Exception, exception: