changeset a337813b7158 in sao:4.2
details: https://hg.tryton.org/sao?cmd=changeset;node=a337813b7158
description:
        Allow all models for reference if there is no restriction

        If the allowed models is empty, it means that there is no constraint on 
the
        reference model. So we must allow all of them.

        issue8300
        review275311002
        (grafted from d32a1b5e5be16d0a3ef17d3c28e572e071189188)
diffstat:

 src/common.js |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r 2b4a13474e39 -r a337813b7158 src/common.js
--- a/src/common.js     Wed Apr 24 23:45:06 2019 +0200
+++ b/src/common.js     Fri Apr 26 12:04:10 2019 +0200
@@ -692,7 +692,8 @@
 
         var _model_evaluator = function(allowed_models) {
             return function(value) {
-                return ~allowed_models.indexOf(value[0]);
+                return ~allowed_models.indexOf(value[0]) ||
+                    jQuery.isEmptyObject(allowed_models);
             };
         };
 

Reply via email to