From b85a135a89d33f08492ad829f72bf8d6f8afc71a Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 29 May 2019 09:49:43 +0000 Subject: [PATCH] [FIX] website_slides: order channels by the natural order when unspecified In the backend, the user has the possibility in the channels list to drag and drop channels to define their order, thanks to the `sequence`. This order was then not respected in the front-end when displaying the slides channel `/slides/all`. This was basically not possible for the user to control the order in which the channels were displayed. With this revision, when the order is not specified to the controller, or is wrong, it fallbacks to `None`, which therefore follows the slides channel natural order, which is `sequence, id`. The user can now control the order of the slides channels in the front-end. closes odoo/odoo#33745 Signed-off-by: Thibault Delavallee (tde) --- addons/website_slides/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_slides/controllers/main.py b/addons/website_slides/controllers/main.py index b18987a2f10..2385bf60d21 100644 --- a/addons/website_slides/controllers/main.py +++ b/addons/website_slides/controllers/main.py @@ -294,7 +294,7 @@ class WebsiteSlides(WebsiteProfile): domain = request.website.website_domain() domain = self._build_channel_domain(domain, slide_type=slide_type, my=my, **post) - order = self._channel_order_by_criterion.get(post.get('sorting', 'date'), 'create_date desc') + order = self._channel_order_by_criterion.get(post.get('sorting')) channels = request.env['slide.channel'].search(domain, order=order) # channels_layouted = list(itertools.zip_longest(*[iter(channels)] * 4, fillvalue=None))