[FIX] website_blog: order of blog_post must be by create_date

bzr revid: chm@openerp.com-20140331144140-hjokx0g6jklxp18m
This commit is contained in:
chm@openerp.com 2014-03-31 16:41:40 +02:00
parent b6ba6d9a9c
commit 0162ee6aff
2 changed files with 3 additions and 2 deletions

View File

@ -99,7 +99,7 @@ class WebsiteBlog(http.Controller):
blog_posts = None
blog_obj = request.registry['blog.blog']
blog_ids = blog_obj.search(cr, uid, [], context=context)
blog_ids = blog_obj.search(cr, uid, [], order="create_date asc", context=context)
blogs = blog_obj.browse(cr, uid, blog_ids, context=context)
path_filter = ""
@ -115,7 +115,7 @@ class WebsiteBlog(http.Controller):
path_filter += "date/%s" % date
domain += [("create_date", ">=", date.split("_")[0]), ("create_date", "<=", date.split("_")[1])]
blog_post_ids = blog_post_obj.search(cr, uid, domain, context=context)
blog_post_ids = blog_post_obj.search(cr, uid, domain, order="create_date asc", context=context)
blog_posts = blog_post_obj.browse(cr, uid, blog_post_ids, context=context)
pager = request.website.pager(

View File

@ -236,6 +236,7 @@
<record id="blog_post_3" model="blog.post">
<field name="name">Touchscreen Point of Sale for 6.1</field>
<field name="blog_id" ref="blog_blog_1"/>
<field name="create_date" eval="(DateTime.today() - relativedelta(months=2)).strftime('%Y-%m-%d %H:%M')"/>
<field name="tag_ids" eval="[(6, 0, [ref('blog_tag_1'), ref('blog_tag_2')])]"/>
<field name="website_meta_keywords">Point of Sale, Hardware, Interface, Payment Terminal, Store</field>
<field name="website_meta_description">Point of Sale with no installation required that runs online and offline.</field>