diff --git a/sao/src/common.js b/sao/src/common.js index b6ae3e3b6e..0686ffd498 100644 --- a/sao/src/common.js +++ b/sao/src/common.js @@ -1132,7 +1132,7 @@ }, stringable: function(domain) { var stringable_ = function(clause) { - if (!clause) { + if (!clause || jQuery.isEmptyObject(clause)) { return true; } var is_array = function(e) { diff --git a/sao/tests/sao.js b/sao/tests/sao.js index 3f124027db..d3885b5dcc 100644 --- a/sao/tests/sao.js +++ b/sao/tests/sao.js @@ -2106,6 +2106,8 @@ }); var valid = ['name', '=', 'Doe']; var invalid = ['surname', '=', 'John']; + QUnit.ok(parser.stringable([])); + QUnit.ok(parser.stringable([[]])); QUnit.ok(parser.stringable([valid])); QUnit.ok(!parser.stringable([invalid])); QUnit.ok(parser.stringable(['AND', valid])); diff --git a/tryton/tryton/tests/test_common_domain_parser.py b/tryton/tryton/tests/test_common_domain_parser.py index c46974c624..19c8fbcf1b 100644 --- a/tryton/tryton/tests/test_common_domain_parser.py +++ b/tryton/tryton/tests/test_common_domain_parser.py @@ -593,6 +593,8 @@ class DomainParserTestCase(TestCase): }) valid = ('name', '=', 'Doe') invalid = ('surname', '=', 'John') + self.assertTrue(dom.stringable([])) + self.assertTrue(dom.stringable([[]])) self.assertTrue(dom.stringable([valid])) self.assertFalse(dom.stringable([invalid])) self.assertTrue(dom.stringable(['AND', valid]))