Make domain with None value for xxx2Many fields stringable
issue11810 review412101003
This commit is contained in:
1 parent
bb2be39994
commit
22da602fba
2 files changed
+3
-11
No files matched your search
+2
-11
@@ -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);
|
||||
|
||||
@@ -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"]]));
|
||||
|
||||
Reference in new issue
Block a user