From 22f0570f2bf8254fcba143844657f173e201dd6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 1 Feb 2008 18:59:07 +0100 Subject: [PATCH] Improve error message --- trytond/ir/model.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/trytond/ir/model.py b/trytond/ir/model.py index f19fc73b22..8b0c556ccf 100644 --- a/trytond/ir/model.py +++ b/trytond/ir/model.py @@ -105,19 +105,24 @@ class ModelAccess(OSV): if not row[0][0]: if raise_exception: if mode == 'read': - raise except_orm('AccessError', - 'You can not read this document!') + raise ExceptORM('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 ExceptORM('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 ExceptORM('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 ExceptORM('AccessError', + 'You can not delete this document! (%s)' \ + % model_name) + raise ExceptORM('AccessError', + 'You do not have access to this document! (%s)' \ + % model_name) else: return False return True