diff options
| author | Nasreddin (bon) <bon@odoo.com> | 2021-03-16 13:04:10 +0000 |
|---|---|---|
| committer | Nasreddin (bon) <bon@odoo.com> | 2021-03-16 13:48:20 +0000 |
| commit | 681e709b239c2456c71d1c16bb40de055dfb927c (patch) | |
| tree | 567f23a2859839bb5443b020ca6e1790f59fb062 | |
| parent | 87cbd4be261a426cb28ed6c1de7941c6b751521f (diff) | |
[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#67952
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
| -rw-r--r-- | addons/website_blog/views/snippets/s_latest_posts.xml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/website_blog/views/snippets/s_latest_posts.xml b/addons/website_blog/views/snippets/s_latest_posts.xml index c5f267a0b4a..01628c02643 100644 --- a/addons/website_blog/views/snippets/s_latest_posts.xml +++ b/addons/website_blog/views/snippets/s_latest_posts.xml @@ -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> |
