changeset cc320bb095e3 in sao:6.0
details: https://hg.tryton.org/sao?cmd=changeset&node=cc320bb095e3
description:
Support string as value of Binary field
issue11534
review417311004
(grafted from ec6b533425594469d272a625336d797539bad0c9)
diffstat:
src/model.js | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (23 lines):
diff -r 7de128e26a6e -r cc320bb095e3 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
@@ -2686,7 +2686,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;
@@ -2694,7 +2695,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;
}