From 6ad1fdcf6e7fa58d9f1fdad0b134cf5ebc3d854e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 28 Jun 2013 15:26:48 +0200 Subject: [PATCH] Check read access for Attachment models review921002 --- trytond/ir/attachment.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trytond/ir/attachment.py b/trytond/ir/attachment.py index 09c4d72797..7a31c9639d 100644 --- a/trytond/ir/attachment.py +++ b/trytond/ir/attachment.py @@ -96,10 +96,13 @@ class Attachment(ModelSQL, ModelView): def models_get(): pool = Pool() Model = pool.get('ir.model') + ModelAccess = pool.get('ir.model.access') models = Model.search([]) + access = ModelAccess.get_access([m.model for m in models]) res = [] for model in models: - res.append([model.model, model.name]) + if access[model.model]['read']: + res.append([model.model, model.name]) return res def get_data(self, name):