Nicolas Évrard pushed to branch branch/default at Tryton / Tryton
Commits:
cdca201f by Nicolas Évrard at 2023-04-03T17:02:51+02:00
Handle string value set from domain inversion in MultiSelection fields
Closes #12181
- - - - -
2 changed files:
- sao/src/model.js
- tryton/tryton/gui/window/view_form/model/field.py
Changes:
=====================================
sao/src/model.js
=====================================
@@ -1789,6 +1789,12 @@
return value;
},
set_client: function(record, value, force_change) {
+ if (value === null) {
+ value = [];
+ }
+ if (typeof(value) == 'string') {
+ value = [value];
+ }
if (value) {
value = value.slice().sort();
}
=====================================
tryton/tryton/gui/window/view_form/model/field.py
=====================================
@@ -260,6 +260,10 @@
return value
def set_client(self, record, value, force_change=False):
+ if value is None:
+ value = []
+ if isinstance(value, str):
+ value = [value]
if value:
value = sorted(value)
super().set_client(record, value, force_change=force_change)
View it on Heptapod:
https://foss.heptapod.net/tryton/tryton/-/commit/cdca201f1dd7c8a25de757ba93b9ff883aa9bac3
--
View it on Heptapod:
https://foss.heptapod.net/tryton/tryton/-/commit/cdca201f1dd7c8a25de757ba93b9ff883aa9bac3
You're receiving this email because of your account on foss.heptapod.net.