From 52fe671e6162b1a353f1b969d8684b0ca5450b88 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 10 Dec 2014 13:03:45 +0100 Subject: [PATCH] [FIX] kanban: respect default_order when a groupby is active The `default_order` attribute of a view was applied for a non-grouped kanban view, but was simply ignored when the kanban view was grouped, a common situation. When a groupby is active, the main order is the column being grouped, but the `default_order` is still useful as a secondary sort ordering, within the kanban columns. This patch complements the original patch of rev. 5c0804eaef81c237043844382d6456656070fb9f from PR #520. --- addons/web_kanban/static/src/js/kanban.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index 0cc543cc2c3..cd92aadf303 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -279,6 +279,9 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ var def = $.when([]); var dataset = new instance.web.DataSetSearch(self, self.dataset.model, new instance.web.CompoundContext(self.dataset.get_context(), group.model.context()), group.model.domain()); + if (self.dataset._sort) { + dataset.set_sort(self.dataset._sort); + } if (group.attributes.length >= 1) { def = dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit }); }