From e713ed2a69af9fe97fbe2d54843adc8f1ce689aa Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 20 Nov 2018 09:00:43 +0000 Subject: [FIX] web: implement filter orderedBy related to: #28446 On a pure list view, click on a column to sort the records by that field. Save the filter as favorite Reload, now apply the filter Before this commit, there were two issues: 1. The order of the list was never propagated to search view, which couldn't save the filter with its attribute "sort" 2. There was no mechanism to load the attribute sort from a loading Filter After this commit, those two issues are corrected Unfortunately, complex search view flows are not testable in v11.0 OPW 1906968 closes odoo/odoo#28766 --- addons/web/static/src/js/views/basic/basic_model.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/basic') diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index b9832996de5..0372f7cd5e7 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -3332,7 +3332,7 @@ var BasicModel = AbstractModel.extend({ model: params.modelName, offset: params.offset || (type === 'record' ? _.indexOf(res_ids, res_id) : 0), openGroupByDefault: params.openGroupByDefault, - orderedBy: params.orderedBy || [], + orderedBy: params.orderedBy || (params.context && params.context.orderedBy) || [], orderedResIDs: params.orderedResIDs, parentID: params.parentID, rawContext: params.rawContext, @@ -4016,6 +4016,7 @@ var BasicModel = AbstractModel.extend({ if (options.context !== undefined) { element.context = options.context; + element.orderedBy = options.context.orderedBy || element.orderedBy; } if (options.domain !== undefined) { element.domain = options.domain; -- cgit v1.2.3