From 73e09cbc814c381b8df9af7eccc4e4c8db5b73b5 Mon Sep 17 00:00:00 2001 From: ced <> Date: Tue, 29 Jan 2008 15:05:48 +0000 Subject: [PATCH] Improve error message bzr revid: ced-9f7dfef3f8838e3eea4fe2931aaded3dec62cec4 --- bin/addons/base/ir/ir_model.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bin/addons/base/ir/ir_model.py b/bin/addons/base/ir/ir_model.py index f84a868f269..8ef7ea765bd 100644 --- a/bin/addons/base/ir/ir_model.py +++ b/bin/addons/base/ir/ir_model.py @@ -113,14 +113,19 @@ class ir_model_access(osv.osv): if not r[0][0]: if raise_exception: if mode == 'read': - raise except_orm('AccessError', 'You can not read this document!') + raise except_orm('AccessError', + 'You can not read this document! (%s)' % model_name) elif mode == 'write': - raise except_orm('AccessError', 'You can not write in this document!') + raise except_orm('AccessError', + 'You can not write in this document! (%s)' % model_name) elif mode == 'create': - raise except_orm('AccessError', 'You can not create this kind of document!') + raise except_orm('AccessError', + 'You can not create this kind of document! (%s)' % model_name) elif mode == 'unlink': - raise except_orm('AccessError', 'You can not delete this document!') - raise except_orm('AccessError', 'You do not have access to this document!') + raise except_orm('AccessError', + 'You can not delete this document! (%s)' % model_name) + raise except_orm('AccessError', + 'You do not have access to this document! (%s)' % model_name) else: return False return True