[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:
@@ -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)) {
|
||||
|
||||
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user