changeset a0a88da41b24 in tryton:4.2
details: https://hg.tryton.org/tryton?cmd=changeset;node=a0a88da41b24
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 1b3c6557b7f9b37238b8d23fef20f843bfc8bd6b)
diffstat:

 tryton/common/selection.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 24063bdbcebf -r a0a88da41b24 tryton/common/selection.py
--- a/tryton/common/selection.py        Tue Apr 23 09:07:50 2019 +0200
+++ b/tryton/common/selection.py        Fri Apr 26 12:04:10 2019 +0200
@@ -94,7 +94,7 @@
 
         def _model_evaluator(allowed_models):
             def test(value):
-                return value[0] in allowed_models
+                return value[0] in allowed_models or not allowed_models
             return test
 
         if field.attrs['type'] == 'reference':

Reply via email to