[FIX] web_timeline: order group_by field

Fix bug #2266: before this fix, the lines of the timeline view were always sorted by alphabetical order, ignoring the native order of the model on which the group_by field points to.

Fix duplicate entries in the 'fields' argument when the 'colors' parameters uses the same field in multiple conditions.
This commit is contained in:
Alexis de Lattre
2022-08-02 22:17:09 +02:00
committed by CarlosRoca13
parent 40b956b513
commit 607da7c379
4 changed files with 22 additions and 24 deletions

View File

@@ -11,6 +11,7 @@ odoo.define("web_timeline.TimelineModel", function (require) {
load: function (params) {
this.modelName = params.modelName;
this.fieldNames = params.fieldNames;
this.default_group_by = params.default_group_by;
if (!this.preload_def) {
this.preload_def = $.Deferred();
$.when(
@@ -55,9 +56,12 @@ odoo.define("web_timeline.TimelineModel", function (require) {
return this._rpc({
model: this.modelName,
method: "search_read",
context: this.data.context,
fields: this.fieldNames,
domain: this.data.domain,
kwargs: {
fields: this.fieldNames,
domain: this.data.domain,
order: [{name: this.default_group_by}],
context: this.data.context,
},
}).then((events) => {
this.data.data = events;
this.data.rights = {