details: https://code.tryton.org/tryton/commit/92c36978daba
branch: default
user: Òscar Queraltó Aguilera <[email protected]>
date: Tue Nov 24 23:36:53 2026 +0000
description:
Do not reset existing keys when adding keys to Dict widget
Closes #15194
diffstat:
sao/src/view/form.js | 2 +-
tryton/tryton/gui/window/view_form/view/form_gtk/dictionary.py | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diffs (25 lines):
diff -r 9dcc1f4b4dde -r 92c36978daba sao/src/view/form.js
--- a/sao/src/view/form.js Mon Nov 23 14:25:07 2026 +0100
+++ b/sao/src/view/form.js Tue Nov 24 23:36:53 2026 +0000
@@ -5403,7 +5403,7 @@
this.send_modified();
var value = this.field.get_client(this.record);
for (const key of new_names) {
- value[key] = null;
+ Sao.setdefault(value, key, null);
}
this.field.set_client(this.record, value);
this._display().then(() => {
diff -r 9dcc1f4b4dde -r 92c36978daba
tryton/tryton/gui/window/view_form/view/form_gtk/dictionary.py
--- a/tryton/tryton/gui/window/view_form/view/form_gtk/dictionary.py Mon Nov
23 14:25:07 2026 +0100
+++ b/tryton/tryton/gui/window/view_form/view/form_gtk/dictionary.py Tue Nov
24 23:36:53 2026 +0000
@@ -560,7 +560,8 @@
new_keys = self.field.add_new_keys(ids, self.record)
self.send_modified()
value = self.field.get_client(self.record)
- value.update({k: None for k in new_keys})
+ for key in new_keys:
+ value.setdefault(key, None)
self.field.set_client(self.record, value)
self.display()