[FIX] web: reset dataset orderby on groupby filter.
If the list view had a default order, for instance, default_order="create_date desc", setting a groupby filter kept this default order and the groupby list was therefore not ordered on the groupby field In general, when setting a groupby filter on a list we expect the list to be grouped by the groupby field The reset of the orderby is done only when the list is not grouped and a first groupby filter is applied. The orderby is not reset when adding a new groupby, when one was already applied. It doesn't reset either when passing from 2 groupby clause to 1. It doesn't reset either when passing from 1 groupby clause to none. opw-627233
This commit is contained in:
parent
5fe71a3c21
commit
859979e949
|
@ -860,6 +860,9 @@ instance.web.ViewManager = instance.web.Widget.extend({
|
|||
if (_.isString(groupby)) {
|
||||
groupby = [groupby];
|
||||
}
|
||||
if (!controller.grouped && !_.isEmpty(groupby)){
|
||||
self.dataset.set_sort([]);
|
||||
}
|
||||
$.when(controller.do_search(results.domain, results.context, groupby || [])).then(function() {
|
||||
self.view_completely_inited.resolve();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue