changeset ee651d2da251 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=ee651d2da251
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
diffstat:
src/common.js | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (18 lines):
diff -r 0214b6f02291 -r ee651d2da251 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
@@ -2005,9 +2005,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 || '';