changeset 2c49425ee85a in tryton:5.0
details: https://hg.tryton.org/tryton?cmd=changeset;node=2c49425ee85a
description:
        Ensure translate_widget_set is always called with string

        issue7922
        review56511002
        (grafted from 981903a47ea7c494a9d663a7f51307e5613a93a5)
diffstat:

 tryton/gui/window/view_form/view/form_gtk/char.py   |  2 +-
 tryton/gui/window/view_form/view/form_gtk/widget.py |  2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r ace8d57c7760 -r 2c49425ee85a 
tryton/gui/window/view_form/view/form_gtk/char.py
--- a/tryton/gui/window/view_form/view/form_gtk/char.py Sat Jan 05 18:30:53 
2019 +0100
+++ b/tryton/gui/window/view_form/view/form_gtk/char.py Sun Dec 30 00:17:57 
2018 +0100
@@ -61,7 +61,7 @@
         return entry
 
     def translate_widget_set(self, widget, value):
-        widget.set_text(value or '')
+        widget.set_text(value)
         reset_position(widget)
 
     def translate_widget_get(self, widget):
diff -r ace8d57c7760 -r 2c49425ee85a 
tryton/gui/window/view_form/view/form_gtk/widget.py
--- a/tryton/gui/window/view_form/view/form_gtk/widget.py       Sat Jan 05 
18:30:53 2019 +0100
+++ b/tryton/gui/window/view_form/view/form_gtk/widget.py       Sun Dec 30 
00:17:57 2018 +0100
@@ -195,6 +195,8 @@
                     context=context)[0][self.widget.field_name]
             except RPCException:
                 return
+            if fuzzy_value is None:
+                fuzzy_value = ''
             widget = self.widget.translate_widget()
             label.set_mnemonic_widget(widget)
             self.widget.translate_widget_set(widget, fuzzy_value)

Reply via email to