changeset dd604376d614 in sao:5.0
details: https://hg.tryton.org/sao?cmd=changeset;node=dd604376d614
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 3e81dc9088c3 -r dd604376d614 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
@@ -712,7 +712,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