diff --git a/sao/src/view/form.js b/sao/src/view/form.js index 523a81c23f..d0c9f4e87a 100644 --- a/sao/src/view/form.js +++ b/sao/src/view/form.js @@ -4940,7 +4940,9 @@ function eval_pyson(value){ return value.map(function(e) { return JSON.parse(e); }); }, set_value: function(value) { - value = value.map(function(e) { return JSON.stringify(e); }); + if (value) { + value = value.map(function(e) { return JSON.stringify(e); }); + } this.input.val(value); } }); diff --git a/tryton/tryton/gui/window/view_form/view/form_gtk/dictionary.py b/tryton/tryton/gui/window/view_form/view/form_gtk/dictionary.py index e21a8d6213..e3f306a885 100644 --- a/tryton/tryton/gui/window/view_form/view/form_gtk/dictionary.py +++ b/tryton/tryton/gui/window/view_form/view/form_gtk/dictionary.py @@ -236,9 +236,10 @@ class DictMultiSelectionEntry(DictEntry): selection.handler_block_by_func(self._changed) try: selection.unselect_all() - for v in value: - if v in value2path: - selection.select_path(value2path[v]) + if value: + for v in value: + if v in value2path: + selection.select_path(value2path[v]) finally: selection.handler_unblock_by_func(self._changed)