Add filter to show attachments that has allow galatea

This commit is contained in:
Raimon Esteve 2019-08-23 12:47:55 +02:00
parent 5062d9e336
commit e10c5486df
1 changed files with 4 additions and 1 deletions

View File

@ -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',