Skip to content
Permalink
Browse files

[FIX]web: context group by - js

Depending on the context (group_by or default_group_by),
pyUtils.eval('context', somerawcontext) will return a an object with a
group_by field that is a string or a list of strings (respectivly)

_readGroup & _renderGroupRow were always expecting a list of strings,
which resulted in group_bys on a single letter, which of course didn't
match.

opw-1941273
  • Loading branch information...
mao-odoo committed Feb 18, 2019
1 parent a9fa46f commit 52bff15803142bea0ed03a39644e4de3a532004e
@@ -3823,7 +3823,7 @@ var BasicModel = AbstractModel.extend({
*/
_readGroup: function (list, options) {
var self = this;
var groupByField = list.groupedBy[0];
var groupByField = typeof list.groupedBy === "string" ? list.groupedBy : list.groupedBy[0];
var rawGroupBy = groupByField.split(':')[0];
var fields = _.uniq(list.getFieldNames().concat(rawGroupBy));
return this._rpc({
@@ -424,7 +424,7 @@ var ListRenderer = BasicRenderer.extend({
$cells.unshift($('<td>'));
}
var name = group.value === undefined ? _t('Undefined') : group.value;
var groupBy = this.state.groupedBy[groupLevel];
var groupBy = typeof this.state.groupedBy === "string" ? this.state.groupedBy : this.state.groupedBy[groupLevel];
if (group.fields[groupBy.split(':')[0]].type !== 'boolean') {
name = name || _t('Undefined');
}

0 comments on commit 52bff15

Please sign in to comment.
You can’t perform that action at this time.