[FIX] web: MockServer: read_group __domain

read_group returns a __domain for each group, which is the
conjunction of the domain given for the read_group with the domain
matching the given group.

The MockServer didn't reproduce that behavior.

Moreover, the BasicModel did again that conjunction, leading to
domains with redundant subdomains.
This commit is contained in:
Aaron Bohy
2017-04-11 19:44:38 +02:00
parent e1b68dae50
commit 6e1875ac7e
3 changed files with 3 additions and 3 deletions
@@ -2072,7 +2072,7 @@ var BasicModel = AbstractModel.extend({
var newGroup = self._makeDataPoint({
modelName: list.model,
count: group[rawGroupBy + '_count'],
domain: list.domain.concat(group.__domain),
domain: group.__domain,
context: list.context,
fields: list.fields,
fieldNames: list.fieldNames,
@@ -601,7 +601,7 @@ var MockServer = Class.extend({
__domain: [[
groupByField, "=",
val instanceof Array ? val[0] : (val || false)
]]
]].concat(kwargs.domain || []),
};
var field = self.data[model].fields[groupByField];
if (field.type === 'many2one' && !_.isArray(val)) {
+1 -1
View File
@@ -1107,7 +1107,7 @@ QUnit.module('Views', {
nbRPCs.readGroup++;
} else if (route === '/web/dataset/search_read') {
// called twice (once when opening the group, once when sorting)
assert.deepEqual(args.domain, [['m2o', '=', 1], ['foo', '=', 'blip']],
assert.deepEqual(args.domain, [['foo', '=', 'blip'], ['m2o', '=', 1]],
"nested search_read should be called with correct domain");
nbRPCs.searchRead++;
}