Catch exception when creating res.user.warning
This commit is contained in:
1 parent
d6a4e71b66
commit
266443843e
1 file changed
+9
-5
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user