[FIX] website_blog: use related to display the image from the author from a blog without that the partner is 'website_published'.

This commit is contained in:
Jeremy Kersten 2014-10-28 14:12:39 +01:00
parent 4ff1c7c8b9
commit b95b134285
2 changed files with 4 additions and 5 deletions

View File

@ -92,6 +92,9 @@ class BlogPost(osv.Model):
'res.users', 'Last Contributor',
select=True, readonly=True,
),
'author_avatar': fields.related(
'author_id', 'image_small',
string="Avatar", type="binary"),
'visits': fields.integer('No of Views'),
'ranking': fields.function(_compute_ranking, string='Ranking', type='float'),
}

View File

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