changeset d107b17c7ae5 in tryton:5.6
details: https://hg.tryton.org/tryton?cmd=changeset;node=d107b17c7ae5
description:
        Fall-back to internal selection value if selection is a string

        When DomainParser format a domain from a DomainValidationError, the 
field
        definition may contain as selection as string. At this place we can not 
really
        make an other RPC call to convert the selection so we fall-back to the 
internal
        value.

        issue9989
        review349271002
        (grafted from 9bf28fc36d790a21813d9ac3e8f921d690b6b88e)
diffstat:

 tryton/common/domain_parser.py |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (15 lines):

diff -r 5ce5e8cc6f97 -r d107b17c7ae5 tryton/common/domain_parser.py
--- a/tryton/common/domain_parser.py    Mon Jan 18 23:29:44 2021 +0100
+++ b/tryton/common/domain_parser.py    Fri Jan 22 01:11:08 2021 +0100
@@ -329,7 +329,10 @@
             '{0:.{1}f}'.format(value * factor or 0, digit), True)
 
     def format_selection():
-        selections = dict(field['selection'])
+        if isinstance(field['selection'], (tuple, list)):
+            selections = dict(field['selection'])
+        else:
+            selections = {}
         return selections.get(value, value) or ''
 
     def format_reference():

Reply via email to