changeset 04b3f55dae05 in sao:5.0
details: https://hg.tryton.org/sao?cmd=changeset&node=04b3f55dae05
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 6dd69758f61c -r 04b3f55dae05 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
@@ -2499,7 +2499,8 @@
_default: null,
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;
@@ -2507,7 +2508,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;
}