tryton-sao 6.4.13 → 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,14 @@
1
1
 
2
+ Version 6.4.15 - 2023-05-17
3
+ ---------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
7
+ Version 6.4.14 - 2023-05-03
8
+ ---------------------------
9
+ * Bug fixes (see mercurial logs for details)
10
+
11
+
2
12
  Version 6.4.13 - 2023-04-01
3
13
  ---------------------------
4
14
  * Bug fixes (see mercurial logs for details)
@@ -507,7 +507,9 @@ var Sao = {};
507
507
  }
508
508
  try {
509
509
  attributes.view_ids = loads(params.views || '[]');
510
- attributes.limit = loads(params.limi || 'null');
510
+ if (params.limit !== undefined) {
511
+ attributes.limit = loads(params.limit || 'null');
512
+ }
511
513
  attributes.name = loads(params.name || '""');
512
514
  attributes.search_value = loads(params.search_value || '[]');
513
515
  attributes.domain = loads(params.domain || '[]');
@@ -7176,6 +7178,25 @@ var Sao = {};
7176
7178
  return el.html();
7177
7179
  };
7178
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
+
7179
7200
  }());
7180
7201
 
7181
7202
  /* This file is part of Tryton. The COPYRIGHT file at the top level of
@@ -8930,6 +8951,12 @@ var Sao = {};
8930
8951
  return value;
8931
8952
  },
8932
8953
  set_client: function(record, value, force_change) {
8954
+ if (value === null) {
8955
+ value = [];
8956
+ }
8957
+ if (typeof(value) == 'string') {
8958
+ value = [value];
8959
+ }
8933
8960
  if (value) {
8934
8961
  value = value.slice().sort();
8935
8962
  }
@@ -17630,7 +17657,7 @@ function eval_pyson(value){
17630
17657
  var record = this.record;
17631
17658
  var field_size = record.expr_eval(
17632
17659
  this.attributes.size) || -1;
17633
- field_size -= this.field.get_eval(record);
17660
+ field_size -= this.field.get_eval(record).length;
17634
17661
  var win = new Sao.Window.Form(this.screen, update_sequence, {
17635
17662
  new_: true,
17636
17663
  many: field_size,
@@ -18481,17 +18508,10 @@ function eval_pyson(value){
18481
18508
  value = jQuery.when(null);
18482
18509
  }
18483
18510
  value.done(data => {
18484
- var url, blob;
18485
18511
  if (record !== this.record) {
18486
18512
  return;
18487
18513
  }
18488
- if (!data) {
18489
- url = null;
18490
- } else {
18491
- blob = new Blob([data]);
18492
- url = window.URL.createObjectURL(blob);
18493
- }
18494
- this.image.attr('src', url);
18514
+ this.image.attr('src', Sao.common.image_url(data));
18495
18515
  this.update_buttons(Boolean(data));
18496
18516
  });
18497
18517
  },
@@ -20287,6 +20307,9 @@ function eval_pyson(value){
20287
20307
 
20288
20308
  // Set column visibility depending on attributes and domain
20289
20309
  var visible_columns = 1; // start at 1 because of the checkbox
20310
+ if (this.optionals.length && !this.draggable) {
20311
+ visible_columns += 1;
20312
+ }
20290
20313
  var domain = [];
20291
20314
  if (!jQuery.isEmptyObject(this.screen.domain)) {
20292
20315
  domain.push(this.screen.domain);
@@ -20412,7 +20435,8 @@ function eval_pyson(value){
20412
20435
  }).map(function(row) {
20413
20436
  return row.el;
20414
20437
  }));
20415
- if (this.display_size < this.group.length) {
20438
+ if ((this.display_size < this.group.length) &&
20439
+ (!this.tbody.children().last().hasClass('more-row'))) {
20416
20440
  var more_row = jQuery('<tr/>', {
20417
20441
  'class': 'more-row',
20418
20442
  });
@@ -20425,8 +20449,17 @@ function eval_pyson(value){
20425
20449
  'title': Sao.i18n.gettext("More"),
20426
20450
  }).text(Sao.i18n.gettext('More')
20427
20451
  ).click(() => {
20452
+ var height = this.table.height();
20428
20453
  this.display_size += Sao.config.display_size;
20429
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
+ });
20430
20463
  });
20431
20464
  more_cell.append(more_button);
20432
20465
  more_row.append(more_cell);
@@ -20546,6 +20579,11 @@ function eval_pyson(value){
20546
20579
  Sao.i18n.BC47(Sao.i18n.getlang()), options);
20547
20580
  sum_ = (sum_ || 0).toLocaleString(
20548
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()));
20549
20587
  }
20550
20588
  aggregate = selected_sum + ' / ' + sum_;
20551
20589
  }
@@ -22272,14 +22310,7 @@ function eval_pyson(value){
22272
22310
  }
22273
22311
  const render = () => {
22274
22312
  const set_src = data => {
22275
- var img_url, blob;
22276
- if (!data) {
22277
- img_url = null;
22278
- } else {
22279
- blob = new Blob([data]);
22280
- img_url = window.URL.createObjectURL(blob);
22281
- }
22282
- cell.attr('src', img_url);
22313
+ cell.attr('src', Sao.common.image_url(data));
22283
22314
  };
22284
22315
 
22285
22316
  var value = this.field.get_client(record);
@@ -25776,7 +25807,8 @@ function eval_pyson(value){
25776
25807
  } else {
25777
25808
  domain = this.screen.search_domain(
25778
25809
  this.screen.screen_container.get_text());
25779
- if (!this.ignore_search_limit.prop('checked')) {
25810
+ if (!this.ignore_search_limit.prop('checked') &&
25811
+ this.screen.limit !== null) {
25780
25812
  query_string.push(['s', this.screen.limit.toString()]);
25781
25813
  query_string.push(
25782
25814
  ['p', Math.floor(