changeset bae6e84680a2 in sao:5.6
details: https://hg.tryton.org/sao?cmd=changeset;node=bae6e84680a2
description:
Fall-back to internal selection value if selection is a string
When DomainParser format a domain from a DomainValidationError, the
field
definition may contain as selection as string. At this place we can not
really
make an other RPC call to convert the selection so we fall-back to the
internal
value.
issue9989
review349271002
(grafted from ee651d2da2519ceb8f5a627a6aaf8b34eb88a32e)
diffstat:
src/common.js | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (18 lines):
diff -r d5d391df26af -r bae6e84680a2 src/common.js
--- a/src/common.js Mon Jan 18 23:29:44 2021 +0100
+++ b/src/common.js Fri Jan 22 01:11:08 2021 +0100
@@ -1980,9 +1980,11 @@
return (value * factor).toFixed(digit);
};
var format_selection = function() {
- for (var i = 0; i < field.selection.length; i++) {
- if (field.selection[i][0] == value) {
- return field.selection[i][1];
+ if (field.selection instanceof Array) {
+ for (var i = 0; i < field.selection.length; i++) {
+ if (field.selection[i][0] == value) {
+ return field.selection[i][1];
+ }
}
}
return value || '';