summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome/view_manager.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js/chrome/view_manager.js')
-rw-r--r--addons/web/static/src/js/chrome/view_manager.js32
1 files changed, 6 insertions, 26 deletions
diff --git a/addons/web/static/src/js/chrome/view_manager.js b/addons/web/static/src/js/chrome/view_manager.js
index 75029d4cc27..3f3cec9ec7f 100644
--- a/addons/web/static/src/js/chrome/view_manager.js
+++ b/addons/web/static/src/js/chrome/view_manager.js
@@ -87,12 +87,6 @@ var ViewManager = Widget.extend(ControlPanelMixin, {
this.active_view = null;
this.registry = view_registry;
this.title = this.action.name;
- var actionGroupBy = self.action.context.group_by;
- if (!actionGroupBy) {
- actionGroupBy = [];
- } else if (typeof actionGroupBy === 'string') {
- actionGroupBy = [actionGroupBy];
- }
_.each(views, function (view) {
var view_type = view[1] || view.view_type;
var View = self.registry.get(view_type); //.prototype.config.Controller;
@@ -114,7 +108,6 @@ var ViewManager = Widget.extend(ControlPanelMixin, {
action: self.action,
limit: self.action.limit,
views: self.action.views,
- groupBy: actionGroupBy,
}, self.flags, self.flags[view_type], view.options),
searchable: View.prototype.searchable,
title: self.title,
@@ -271,16 +264,6 @@ var ViewManager = Widget.extend(ControlPanelMixin, {
if (!view.loaded) {
view_options = _.extend({}, view.options, view_options, self.env);
- if (view_options.groupBy && !view_options.groupBy.length) {
- var actionContext = view_options ? view_options.action.context : {};
- var actionGroupBy = actionContext.group_by;
- if (!actionGroupBy) {
- actionGroupBy = [];
- } else if (typeof actionGroupBy === 'string') {
- actionGroupBy = [actionGroupBy];
- }
- view_options.groupBy = actionGroupBy;
- }
view.loaded = $.Deferred();
self.create_view(view, view_options).then(function(controller) {
view.controller = controller;
@@ -512,18 +495,15 @@ var ViewManager = Widget.extend(ControlPanelMixin, {
throw new Error(_.str.sprintf(_t("Failed to evaluate search criterions")+": \n%s",
JSON.stringify(results.error)));
}
- // this.dataset._model = new Model(this.dataset.model, results.context, results.domain);
- // var groupby = results.group_by.length ? results.group_by : action_context.group_by;
- // if (_.isString(groupby)) {
- // groupby = [groupby];
- // }
- // if (!controller.grouped && !_.isEmpty(groupby)){
- // this.dataset.set_sort([]);
- // }
+ // FORWARDPORT THIS UP TO SAAS-11.1 ONLY, NOT LATER
+ var groupby = results.group_by.length ? results.group_by : action_context.group_by;
+ if (_.isString(groupby)) {
+ groupby = [groupby];
+ }
return {
context: results.context,
domain: results.domain,
- groupBy: results.group_by,
+ groupBy: groupby || [],
};
},
do_push_state: function(state) {