tryton-sao 6.4.14 → 6.4.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ Version 6.4.15 - 2023-05-17
3
+ ---------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
2
7
  Version 6.4.14 - 2023-05-03
3
8
  ---------------------------
4
9
  * Bug fixes (see mercurial logs for details)
@@ -7178,6 +7178,25 @@ var Sao = {};
7178
7178
  return el.html();
7179
7179
  };
7180
7180
 
7181
+ Sao.common.image_url = function(data) {
7182
+ if (!data) {
7183
+ return null;
7184
+ }
7185
+ var type = '';
7186
+ try {
7187
+ var xml = data;
7188
+ if (xml instanceof Uint8Array) {
7189
+ xml = new TextDecoder().decode(data);
7190
+ }
7191
+ if (jQuery.parseXML(xml)) {
7192
+ type = 'image/svg+xml';
7193
+ }
7194
+ } catch (e) {
7195
+ }
7196
+ var blob = new Blob([data], {type: type});
7197
+ return window.URL.createObjectURL(blob);
7198
+ };
7199
+
7181
7200
  }());
7182
7201
 
7183
7202
  /* This file is part of Tryton. The COPYRIGHT file at the top level of
@@ -18489,17 +18508,10 @@ function eval_pyson(value){
18489
18508
  value = jQuery.when(null);
18490
18509
  }
18491
18510
  value.done(data => {
18492
- var url, blob;
18493
18511
  if (record !== this.record) {
18494
18512
  return;
18495
18513
  }
18496
- if (!data) {
18497
- url = null;
18498
- } else {
18499
- blob = new Blob([data]);
18500
- url = window.URL.createObjectURL(blob);
18501
- }
18502
- this.image.attr('src', url);
18514
+ this.image.attr('src', Sao.common.image_url(data));
18503
18515
  this.update_buttons(Boolean(data));
18504
18516
  });
18505
18517
  },
@@ -20295,6 +20307,9 @@ function eval_pyson(value){
20295
20307
 
20296
20308
  // Set column visibility depending on attributes and domain
20297
20309
  var visible_columns = 1; // start at 1 because of the checkbox
20310
+ if (this.optionals.length && !this.draggable) {
20311
+ visible_columns += 1;
20312
+ }
20298
20313
  var domain = [];
20299
20314
  if (!jQuery.isEmptyObject(this.screen.domain)) {
20300
20315
  domain.push(this.screen.domain);
@@ -20420,7 +20435,8 @@ function eval_pyson(value){
20420
20435
  }).map(function(row) {
20421
20436
  return row.el;
20422
20437
  }));
20423
- if (this.display_size < this.group.length) {
20438
+ if ((this.display_size < this.group.length) &&
20439
+ (!this.tbody.children().last().hasClass('more-row'))) {
20424
20440
  var more_row = jQuery('<tr/>', {
20425
20441
  'class': 'more-row',
20426
20442
  });
@@ -20433,8 +20449,17 @@ function eval_pyson(value){
20433
20449
  'title': Sao.i18n.gettext("More"),
20434
20450
  }).text(Sao.i18n.gettext('More')
20435
20451
  ).click(() => {
20452
+ var height = this.table.height();
20436
20453
  this.display_size += Sao.config.display_size;
20437
20454
  this.display();
20455
+ height -= this.treeview.height();
20456
+ height -= 50;
20457
+ if (this.tfoot) {
20458
+ height -= this.tfoot.height();
20459
+ }
20460
+ this.treeview[0].scroll({
20461
+ 'top': height,
20462
+ });
20438
20463
  });
20439
20464
  more_cell.append(more_button);
20440
20465
  more_row.append(more_cell);
@@ -20554,6 +20579,11 @@ function eval_pyson(value){
20554
20579
  Sao.i18n.BC47(Sao.i18n.getlang()), options);
20555
20580
  sum_ = (sum_ || 0).toLocaleString(
20556
20581
  Sao.i18n.BC47(Sao.i18n.getlang()), options);
20582
+ } else {
20583
+ selected_sum = (selected_sum || 0).toLocaleString(
20584
+ Sao.i18n.BC47(Sao.i18n.getlang()));
20585
+ sum_ = (sum_ || 0).toLocaleString(
20586
+ Sao.i18n.BC47(Sao.i18n.getlang()));
20557
20587
  }
20558
20588
  aggregate = selected_sum + ' / ' + sum_;
20559
20589
  }
@@ -22280,14 +22310,7 @@ function eval_pyson(value){
22280
22310
  }
22281
22311
  const render = () => {
22282
22312
  const set_src = data => {
22283
- var img_url, blob;
22284
- if (!data) {
22285
- img_url = null;
22286
- } else {
22287
- blob = new Blob([data]);
22288
- img_url = window.URL.createObjectURL(blob);
22289
- }
22290
- cell.attr('src', img_url);
22313
+ cell.attr('src', Sao.common.image_url(data));
22291
22314
  };
22292
22315
 
22293
22316
  var value = this.field.get_client(record);