[FIX] website_blog: display post_date on latests blogs

Issue

	- Install 'Blogs' module
	- Create a blog post
	- Set published_date to 01/01/1997
	- Go to website
	- Edit any page and add a 'Blog Posts' Block
	- Set 'Layout' to 'Cards' (or 'Horizontal')
	- Save

	In snippet cards, the blog post date is not the published date.

Cause

	Displaying update date ('write_date' field) instead of
	the published date ('post_date' field).

Solution

	Replace 'write_date' by 'post_date'.

opw-2443104

closes odoo/odoo#67985

X-original-commit: 681e709b239c2456c71d1c16bb40de055dfb927c
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
Nasreddin (bon)
2021-03-16 16:54:39 +00:00
parent 6ca12a2545
commit 9857b96b97
@@ -61,7 +61,7 @@
<figure t-foreach="posts" t-as="p" class="post s_latest_posts_post col-md-6 col-lg-4">
<figcaption>
<h4 class="mb0"><a t-att-href="'/blog/%s/%s' % (p.blog_id.id, p.id)"><t t-esc="p.name"/></a></h4>
<h5 class="mt0 mb4" t-field="p.write_date" t-options='{"format": "dd/MM"}' />
<h5 class="mt0 mb4" t-field="p.post_date" t-options='{"format": "dd/MM"}' />
</figcaption>
<a t-att-href="'/blog/%s/%s' % (p.blog_id.id, p.id)">
<t t-call="website.record_cover">
@@ -85,7 +85,7 @@
<a t-att-href="'/blog/%s/%s' % (p.blog_id.id, p.id)"><h4 class="mb-0"><t t-esc="p.name"/></h4></a>
</div>
<div class="card-footer d-flex justify-content-between">
<span class="text-muted mb-0" t-field="p.write_date" t-options='{"format": "MMM d, yyyy"}' />
<span class="text-muted mb-0" t-field="p.post_date" t-options='{"format": "MMM d, yyyy"}' />
<span class="text-muted mb-0">In <a class="font-weight-bold" t-esc="p.blog_id.name" t-att-href="'/blog/%s' % (p.blog_id.id)" /></span>
</div>
</div>