Skip to content

Commit

Permalink
[FIX] website_event, website_sale: _order on is_published
Browse files Browse the repository at this point in the history
As fbbf24f introduced multiwebsite and `website_published` became a
related and/or a computed field (depending of the mixin), we should not order
on this field as it is not on DB anymore.

We now have the field `is_published` that replace `website_published`.
  • Loading branch information
rdeodoo committed Aug 14, 2018
1 parent fd95839 commit 75f3d8f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion addons/website_event/controllers/main.py
Expand Up @@ -123,7 +123,7 @@ def dom_without(without):
order = 'date_begin desc'
if searches["country"] != 'all': # if we are looking for a specific country
order = 'is_online, ' + order # show physical events first
order = 'website_published desc, ' + order
order = 'is_published desc, ' + order
events = Event.search(dom_without("none"), limit=step, offset=pager['offset'], order=order)

values = {
Expand Down
2 changes: 1 addition & 1 deletion addons/website_sale/controllers/main.py
Expand Up @@ -174,7 +174,7 @@ def get_attribute_value_ids(self, product):
def _get_search_order(self, post):
# OrderBy will be parsed in orm and so no direct sql injection
# id is added to be sure that order is a unique sort key
return 'website_published desc,%s , id desc' % post.get('order', 'website_sequence desc')
return 'is_published desc,%s , id desc' % post.get('order', 'website_sequence desc')

def _get_search_domain(self, search, category, attrib_values):
domain = request.website.sale_product_domain()
Expand Down
2 changes: 1 addition & 1 deletion addons/website_sale/models/product.py
Expand Up @@ -106,7 +106,7 @@ def name_get(self):

class ProductTemplate(models.Model):
_inherit = ["product.template", "website.seo.metadata", 'website.published.multi.mixin', 'rating.mixin']
_order = 'website_published desc, website_sequence desc, name'
_order = 'is_published desc, website_sequence desc, name'
_name = 'product.template'
_mail_post_access = 'read'

Expand Down

0 comments on commit 75f3d8f

Please sign in to comment.