changeset a90901107c74 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=a90901107c74
description:
        Ensure translate_widget_set is always called with string

        issue7922
        review56511002
diffstat:

 src/view/form.js |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 2fad51eb6811 -r a90901107c74 src/view/form.js
--- a/src/view/form.js  Sat Dec 22 00:19:20 2018 +0100
+++ b/src/view/form.js  Sun Dec 30 00:17:57 2018 +0100
@@ -1220,7 +1220,7 @@
                 prm.then(function() {
                     Sao.rpc(args, widget.model.session)
                             .then(function(fuzzy_value) {
-                        value = fuzzy_value[0][widget.field_name];
+                        value = fuzzy_value[0][widget.field_name] || '';
                         widget.translate_widget_set(
                             input, value);
                         widget.translate_widget_set_readonly(
@@ -1339,7 +1339,7 @@
         el.prop('readonly', value);
     };
     Sao.View.Form.TranslateMixin.translate_widget_set = function(el, value) {
-        el.val(value || '');
+        el.val(value);
     };
     Sao.View.Form.TranslateMixin.translate_widget_get = function(el) {
         return el.val();

Reply via email to