Make domain with None value for xxx2Many fields stringable

issue11810
review412101003
This commit is contained in:
Cédric Krier committed 2022-10-28 00:39:04 +02:00
1 parent bb2be39994
commit 22da602fba
2 files changed
+3 -11

No files matched your search

+2 -11
View File
@@ -1183,17 +1183,8 @@
if (~['many2one', 'one2one', 'one2many', 'many2many']
.indexOf(field.type)) {
var test = function(value) {
if (field.type == 'many2one') {
if ((typeof value != 'string') &&
(value !== null)) {
return false;
}
} else {
if (typeof value != 'string') {
return false;
}
}
return true;
return ((typeof value == 'string') ||
(value === null));
};
if (value instanceof Array) {
return value.every(test);
+1
View File
@@ -2109,6 +2109,7 @@
QUnit.ok(parser.stringable([['relation.rec_name', '=', 'Foo']]));
QUnit.ok(!parser.stringable([['relation', '=', 1]]));
QUnit.ok(parser.stringable([['relations', '=', 'Foo']]));
QUnit.ok(parser.stringable([['relations', '=', null]]));
QUnit.ok(parser.stringable([['relations', 'in', ['Foo']]]));
QUnit.ok(!parser.stringable([['relations', 'in', [42]]]));
QUnit.ok(parser.stringable([['relation.name', '=', "Foo"]]));