Skip to content

Commit b95b134

Browse files
committed
[FIX] website_blog: use related to display the image from the author from a blog without that the partner is 'website_published'.
1 parent 4ff1c7c commit b95b134

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

addons/website_blog/models/website_blog.py

+3
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ def _compute_ranking(self, cr, uid, ids, name, arg, context=None):
9292
'res.users', 'Last Contributor',
9393
select=True, readonly=True,
9494
),
95+
'author_avatar': fields.related(
96+
'author_id', 'image_small',
97+
string="Avatar", type="binary"),
9598
'visits': fields.integer('No of Views'),
9699
'ranking': fields.function(_compute_ranking, string='Ranking', type='float'),
97100
}

addons/website_blog/views/website_blog_templates.xml

+1-5
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,7 @@
121121
</div>
122122

123123
<div t-foreach="blog_posts" t-as="blog_post" class="mb32">
124-
125-
<img class="img-circle pull-right mt16"
126-
t-att-src="website.image_url(blog_post.author_id, 'image_small')"
127-
style="width: 50px;"/>
128-
124+
<span t-field="blog_post.author_avatar" t-field-options='{"widget": "image", "class": "img-circle pull-right mt16 media-object"}' />
129125
<a t-attf-href="/blog/#{ slug(blog_post.blog_id) }/post/#{ slug(blog_post) }">
130126
<h2 t-field="blog_post.name" class="mb4"/>
131127
</a>

0 commit comments

Comments
 (0)