diff --git a/sao/src/view/form.js b/sao/src/view/form.js index 71176e6a6d..a18dc2f366 100644 --- a/sao/src/view/form.js +++ b/sao/src/view/form.js @@ -5437,7 +5437,11 @@ function eval_pyson(value){ }, get_value: function() { var value = this.input.val(); - return value.map(function(e) { return JSON.parse(e); }); + if (value && value.length) { + return value.map(function(e) { return JSON.parse(e); }); + } else { + return null; + } }, set_value: function(value) { if (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 5d094526f6..bc89b63899 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 @@ -233,7 +233,7 @@ class DictMultiSelectionEntry(DictEntry): def get_value(self): model, paths = self.tree.get_selection().get_selected_rows() - return [model[path][0] for path in paths] + return [model[path][0] for path in paths] or None def set_value(self, value): value2path = {v: idx for idx, (v, _) in enumerate(self.selection)}