Handle string value set from domain inversion in MultiSelection fields
Closes #12181 (grafted from cdca201f1dd7c8a25de757ba93b9ff883aa9bac3) --HG-- branch : 6.0
This commit is contained in:
1 parent
d217fcf7d5
commit
158d1384d7
2 files changed
+10
No files matched your search
@@ -1792,6 +1792,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();
|
||||
}
|
||||
|
||||
@@ -243,6 +243,10 @@ class MultiSelectionField(Field):
|
||||
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)
|
||||
|
||||
Reference in new issue
Block a user