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