changeset ec6b53342559 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset&node=ec6b53342559
description:
Support string as value of Binary field
issue11534
review417311004
diffstat:
src/model.js | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (23 lines):
diff -r e9d19f24dd30 -r ec6b53342559 src/model.js
--- a/src/model.js Wed Jun 08 09:13:24 2022 +0200
+++ b/src/model.js Wed Jun 08 09:14:38 2022 +0200
@@ -2665,7 +2665,8 @@
},
get_size: function(record) {
var data = record._values[this.name] || 0;
- if (data instanceof Uint8Array) {
+ if ((data instanceof Uint8Array) ||
+ (typeof(data) == 'string')) {
return data.length;
}
return data;
@@ -2673,7 +2674,8 @@
get_data: function(record) {
var data = record._values[this.name] || [];
var prm = jQuery.when(data);
- if (!(data instanceof Uint8Array)) {
+ if (!(data instanceof Uint8Array) &&
+ (typeof(data) != 'string')) {
if (record.id < 0) {
return prm;
}