tryton-sao 6.0.28 → 6.0.30

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,3 +1,13 @@
1
+
2
+ Version 6.0.30 - 2023-05-17
3
+ ---------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
7
+ Version 6.0.29 - 2023-05-03
8
+ ---------------------------
9
+ * Bug fixes (see mercurial logs for details)
10
+
1
11
  Version 6.0.28 - 2023-02-17
2
12
  ---------------------------
3
13
  * Bug fixes (see mercurial logs for details)
@@ -476,7 +476,9 @@ var Sao = {};
476
476
  }
477
477
  try {
478
478
  attributes.view_ids = loads(params.views || '[]');
479
- attributes.limit = loads(params.limi || 'null');
479
+ if (params.limit !== undefined) {
480
+ attributes.limit = loads(params.limit || 'null');
481
+ }
480
482
  attributes.name = loads(params.name || '""');
481
483
  attributes.search_value = loads(params.search_value || '[]');
482
484
  attributes.domain = loads(params.domain || '[]');
@@ -7057,6 +7059,25 @@ var Sao = {};
7057
7059
  return el.html();
7058
7060
  };
7059
7061
 
7062
+ Sao.common.image_url = function(data) {
7063
+ if (!data) {
7064
+ return null;
7065
+ }
7066
+ var type = '';
7067
+ try {
7068
+ var xml = data;
7069
+ if (xml instanceof Uint8Array) {
7070
+ xml = new TextDecoder().decode(data);
7071
+ }
7072
+ if (jQuery.parseXML(xml)) {
7073
+ type = 'image/svg+xml';
7074
+ }
7075
+ } catch (e) {
7076
+ }
7077
+ var blob = new Blob([data], {type: type});
7078
+ return window.URL.createObjectURL(blob);
7079
+ };
7080
+
7060
7081
  }());
7061
7082
 
7062
7083
  /* This file is part of Tryton. The COPYRIGHT file at the top level of
@@ -8853,6 +8874,12 @@ var Sao = {};
8853
8874
  return value;
8854
8875
  },
8855
8876
  set_client: function(record, value, force_change) {
8877
+ if (value === null) {
8878
+ value = [];
8879
+ }
8880
+ if (typeof(value) == 'string') {
8881
+ value = [value];
8882
+ }
8856
8883
  if (value) {
8857
8884
  value = value.slice().sort();
8858
8885
  }
@@ -17370,7 +17397,7 @@ function eval_pyson(value){
17370
17397
  var record = this.record;
17371
17398
  var field_size = record.expr_eval(
17372
17399
  this.attributes.size) || -1;
17373
- field_size -= this.field.get_eval(record);
17400
+ field_size -= this.field.get_eval(record).length;
17374
17401
  var win = new Sao.Window.Form(this.screen, update_sequence, {
17375
17402
  new_: true,
17376
17403
  many: field_size,
@@ -18192,17 +18219,10 @@ function eval_pyson(value){
18192
18219
  value = jQuery.when(null);
18193
18220
  }
18194
18221
  value.done(function(data) {
18195
- var url, blob;
18196
18222
  if (record !== this.record) {
18197
18223
  return;
18198
18224
  }
18199
- if (!data) {
18200
- url = null;
18201
- } else {
18202
- blob = new Blob([data]);
18203
- url = window.URL.createObjectURL(blob);
18204
- }
18205
- this.image.attr('src', url);
18225
+ this.image.attr('src', Sao.common.image_url(data));
18206
18226
  this.update_buttons(Boolean(data));
18207
18227
  }.bind(this));
18208
18228
  },
@@ -19948,7 +19968,8 @@ function eval_pyson(value){
19948
19968
  }).map(function(row) {
19949
19969
  return row.el;
19950
19970
  }));
19951
- if (this.display_size < this.group.length) {
19971
+ if ((this.display_size < this.group.length) &&
19972
+ (!this.tbody.children().last().hasClass('more-row'))) {
19952
19973
  var more_row = jQuery('<tr/>', {
19953
19974
  'class': 'more-row',
19954
19975
  });
@@ -19960,8 +19981,17 @@ function eval_pyson(value){
19960
19981
  'type': 'button'
19961
19982
  }).text(Sao.i18n.gettext('More')
19962
19983
  ).click(function() {
19984
+ var height = this.table.height();
19963
19985
  this.display_size += Sao.config.display_size;
19964
19986
  this.display();
19987
+ height -= this.treeview.height();
19988
+ height -= 50;
19989
+ if (this.tfoot) {
19990
+ height -= this.tfoot.height();
19991
+ }
19992
+ this.treeview[0].scroll({
19993
+ 'top': height,
19994
+ });
19965
19995
  }.bind(this));
19966
19996
  more_cell.append(more_button);
19967
19997
  more_row.append(more_cell);
@@ -20080,6 +20110,11 @@ function eval_pyson(value){
20080
20110
  Sao.i18n.BC47(Sao.i18n.getlang()), options);
20081
20111
  sum_ = (sum_ || 0).toLocaleString(
20082
20112
  Sao.i18n.BC47(Sao.i18n.getlang()), options);
20113
+ } else {
20114
+ selected_sum = (selected_sum || 0).toLocaleString(
20115
+ Sao.i18n.BC47(Sao.i18n.getlang()));
20116
+ sum_ = (sum_ || 0).toLocaleString(
20117
+ Sao.i18n.BC47(Sao.i18n.getlang()));
20083
20118
  }
20084
20119
  aggregate = selected_sum + ' / ' + sum_;
20085
20120
  }
@@ -21737,14 +21772,7 @@ function eval_pyson(value){
21737
21772
  }
21738
21773
  var render = function() {
21739
21774
  var set_src = function(data) {
21740
- var img_url, blob;
21741
- if (!data) {
21742
- img_url = null;
21743
- } else {
21744
- blob = new Blob([data]);
21745
- img_url = window.URL.createObjectURL(blob);
21746
- }
21747
- cell.attr('src', img_url);
21775
+ cell.attr('src', Sao.common.image_url(data));
21748
21776
  }.bind(this);
21749
21777
 
21750
21778
  var value = this.field.get_client(record);
@@ -25161,7 +25189,8 @@ function eval_pyson(value){
25161
25189
  } else {
25162
25190
  domain = this.screen.search_domain(
25163
25191
  this.screen.screen_container.get_text());
25164
- if (!this.ignore_search_limit.prop('checked')) {
25192
+ if (!this.ignore_search_limit.prop('checked') &&
25193
+ this.screen.limit !== null) {
25165
25194
  query_string.push(['s', this.screen.limit.toString()]);
25166
25195
  query_string.push(
25167
25196
  ['p', Math.floor(