From e10c5486df40906aa371691c72b444cc8ec06897 Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Fri, 23 Aug 2019 12:47:55 +0200 Subject: [PATCH] Add filter to show attachments that has allow galatea --- blog.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/blog.py b/blog.py index 17e58b5..4a8f9eb 100644 --- a/blog.py +++ b/blog.py @@ -55,7 +55,10 @@ class Post(ModelSQL, ModelView): comments = fields.One2Many('galatea.blog.comment', 'post', 'Comments') total_comments = fields.Function(fields.Integer("Total Comments"), 'get_totalcomments') - attachments = fields.One2Many('ir.attachment', 'resource', 'Attachments') + attachments = fields.One2Many('ir.attachment', 'resource', 'Attachments', + filter=[ + ('allow_galatea', '=', True), + ]) thumb = fields.Function(fields.Binary('Thumb', filename='thumb_filename'), 'get_thumb', setter='set_thumb') thumb_filename = fields.Char('File Name',