tryton-sao 5.0.51 → 5.0.54

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,12 @@
1
+ Version 5.0.54 - 2022-06-15
2
+ * Bug fixes (see mercurial logs for details)
3
+
4
+ Version 5.0.53 - 2022-06-03
5
+ * Bug fixes (see mercurial logs for details)
6
+
7
+ Version 5.0.52 - 2022-05-06
8
+ * Bug fixes (see mercurial logs for details)
9
+
1
10
  Version 5.0.51 - 2022-04-15
2
11
  * Bug fixes (see mercurial logs for details)
3
12
 
@@ -4384,10 +4384,8 @@ var Sao = {};
4384
4384
  value = null;
4385
4385
  }
4386
4386
  } else if (value.isDate) {
4387
- current_value = this.get(record);
4388
- if (current_value) {
4389
- value = Sao.DateTime.combine(value, current_value);
4390
- }
4387
+ current_value = this.get(record) || Sao.Time();
4388
+ value = Sao.DateTime.combine(value, current_value);
4391
4389
  }
4392
4390
  }
4393
4391
  Sao.field.DateTime._super.set_client.call(this, record, value,
@@ -4849,7 +4847,7 @@ var Sao = {};
4849
4847
  return this._set_value(record, value, false, true);
4850
4848
  }
4851
4849
  var prm = jQuery.when();
4852
- if (value.add || value.update) {
4850
+ if (value && (value.add || value.update)) {
4853
4851
  var context = this.get_context(record);
4854
4852
  var fields = record._values[this.name].model.fields;
4855
4853
  var field_names = {};
@@ -4889,7 +4887,7 @@ var Sao = {};
4889
4887
  to_remove.push(record2);
4890
4888
  }
4891
4889
  });
4892
- if (value.remove) {
4890
+ if (value && value.remove) {
4893
4891
  value.remove.forEach(function(record_id) {
4894
4892
  var record2 = group.get(record_id);
4895
4893
  if (record2) {
@@ -4901,7 +4899,7 @@ var Sao = {};
4901
4899
  group.remove(record2, false, true, false, false);
4902
4900
  }.bind(this));
4903
4901
 
4904
- if (value.add || value.update) {
4902
+ if (value && (value.add || value.update)) {
4905
4903
  prm = prm.then(function(fields) {
4906
4904
  var promises = [];
4907
4905
  group.add_fields(fields);
@@ -5196,7 +5194,8 @@ var Sao = {};
5196
5194
  _default: null,
5197
5195
  get_size: function(record) {
5198
5196
  var data = record._values[this.name] || 0;
5199
- if (data instanceof Uint8Array) {
5197
+ if ((data instanceof Uint8Array) ||
5198
+ (typeof(data) == 'string')) {
5200
5199
  return data.length;
5201
5200
  }
5202
5201
  return data;
@@ -5204,7 +5203,8 @@ var Sao = {};
5204
5203
  get_data: function(record) {
5205
5204
  var data = record._values[this.name] || [];
5206
5205
  var prm = jQuery.when(data);
5207
- if (!(data instanceof Uint8Array)) {
5206
+ if (!(data instanceof Uint8Array) &&
5207
+ (typeof(data) != 'string')) {
5208
5208
  if (record.id < 0) {
5209
5209
  return prm;
5210
5210
  }
@@ -11079,13 +11079,13 @@ function eval_pyson(value){
11079
11079
  if (this.has_target(value)) {
11080
11080
  var m2o_id =
11081
11081
  this.id_from_value(record.field_get(this.field_name));
11082
- if (evt && evt.ctrlKey) {
11082
+ if (evt && (evt.ctrlKey || evt.metaKey)) {
11083
11083
  var params = {};
11084
11084
  params.model = this.get_model();
11085
11085
  params.res_id = m2o_id;
11086
11086
  params.mode = ['form'];
11087
11087
  params.name = this.attributes.string;
11088
- params.context = this.field.get_context(this.record);
11088
+ params.context = this.field().get_context(record);
11089
11089
  Sao.Tab.create(params);
11090
11090
  return;
11091
11091
  }
@@ -12518,8 +12518,8 @@ function eval_pyson(value){
12518
12518
  },
12519
12519
  set_readonly: function(readonly) {
12520
12520
  Sao.View.Form.Image._super.set_readonly.call(this, readonly);
12521
- this.but_select.prop('disable', readonly);
12522
- this.but_clear.prop('disable', readonly);
12521
+ this.but_select.prop('disabled', readonly);
12522
+ this.but_clear.prop('disabled', readonly);
12523
12523
  },
12524
12524
  clear: function() {
12525
12525
  Sao.View.Form.Image._super.clear.call(this);
@@ -14389,7 +14389,7 @@ function eval_pyson(value){
14389
14389
  this.tree.select_changed(this.record);
14390
14390
  this.switch_row();
14391
14391
  } else {
14392
- if (!event_.ctrlKey ||
14392
+ if (!(event_.ctrlKey || event_.metaKey) ||
14393
14393
  this.tree.selection_mode ==
14394
14394
  Sao.common.SELECTION_SINGLE) {
14395
14395
  this.tree.rows.forEach(function(row) {
@@ -14630,7 +14630,8 @@ function eval_pyson(value){
14630
14630
  (event_.which != Sao.common.DOWN_KEYCODE) &&
14631
14631
  (event_.which != Sao.common.ESC_KEYCODE) &&
14632
14632
  (event_.which != Sao.common.RETURN_KEYCODE)) ||
14633
- jQuery(event_.currentTarget).find('.dropdown-menu').length) {
14633
+ jQuery(event_.currentTarget)
14634
+ .find('.dropdown-menu:visible').length) {
14634
14635
  return;
14635
14636
  }
14636
14637
  var td = this._get_column_td(this.edited_column);
@@ -16607,7 +16608,7 @@ function eval_pyson(value){
16607
16608
  };
16608
16609
 
16609
16610
  Sao.common.parse_time = function(format, value) {
16610
- if (jQuery.isEmptyObject(value)) {
16611
+ if (!value) {
16611
16612
  return null;
16612
16613
  }
16613
16614
  var getNumber = function(pattern) {
@@ -17586,7 +17587,7 @@ function eval_pyson(value){
17586
17587
 
17587
17588
  var pslice = function(string, depth) {
17588
17589
  if (depth > 0) {
17589
- return string.substring(0, depth);
17590
+ return string.substring(0, string.length - depth);
17590
17591
  }
17591
17592
  return string;
17592
17593
  };
@@ -17696,8 +17697,8 @@ function eval_pyson(value){
17696
17697
  }
17697
17698
  return results;
17698
17699
  },
17699
- is_leaf: function(element) {
17700
- return ((element instanceof Array) && element.clause);
17700
+ is_subdomain: function(element) {
17701
+ return (element instanceof Array) && !element.clause;
17701
17702
  },
17702
17703
  ending_clause: function(domain, depth) {
17703
17704
  if (depth === undefined) {
@@ -17707,7 +17708,7 @@ function eval_pyson(value){
17707
17708
  return [null, depth];
17708
17709
  }
17709
17710
  var last_element = domain[domain.length - 1];
17710
- if (!this.is_leaf(last_element)) {
17711
+ if (this.is_subdomain(last_element)) {
17711
17712
  return this.ending_clause(last_element, depth + 1);
17712
17713
  }
17713
17714
  return [last_element, depth];
@@ -17718,9 +17719,9 @@ function eval_pyson(value){
17718
17719
  for (i = 0, len=domain.length - 1; i < len; i++) {
17719
17720
  results.push(domain[i]);
17720
17721
  }
17721
- if (!this.is_leaf(domain[i])) {
17722
- results = results.concat(this.replace_ending_clause(domain[i],
17723
- clause));
17722
+ if (this.is_subdomain(domain[i])) {
17723
+ results.push(
17724
+ this.replace_ending_clause(domain[i], clause));
17724
17725
  } else {
17725
17726
  results.push(clause);
17726
17727
  }
@@ -17732,7 +17733,7 @@ function eval_pyson(value){
17732
17733
  }
17733
17734
  var results = domain.slice(0, -1);
17734
17735
  var last_element = domain[domain.length - 1];
17735
- if (!this.is_leaf(last_element)) {
17736
+ if (this.is_subdomain(last_element)) {
17736
17737
  results.push(this.append_ending_clause(last_element, clause,
17737
17738
  depth - 1));
17738
17739
  } else {
@@ -18451,19 +18452,17 @@ function eval_pyson(value){
18451
18452
  }
18452
18453
  },
18453
18454
  simplify: function(value) {
18454
- if ((value instanceof Array) && !this.is_leaf(value)) {
18455
- if ((value.length == 1) && (value[0] instanceof Array) &&
18456
- ((value[0][0] == 'AND') || (value[0][0] == 'OR') ||
18457
- (value[0][0] instanceof Array))) {
18455
+ if (this.is_subdomain(value)) {
18456
+ if ((value.length == 1) && this.is_subdomain(value[0])) {
18458
18457
  return this.simplify(value[0]);
18459
18458
  } else if ((value.length == 2) &&
18460
- ((value[0] == 'AND') || (value[0] == 'OR')) &&
18461
- (value[1] instanceof Array)) {
18459
+ ((value[0] == 'AND') || (value[0] == 'OR')) &&
18460
+ this.is_subdomain(value[1])) {
18462
18461
  return this.simplify(value[1]);
18463
18462
  } else if ((value.length == 3) &&
18464
- ((value[0] == 'AND') || (value[0] == 'OR')) &&
18465
- (value[1] instanceof Array) &&
18466
- (value[0] == value[1][0])) {
18463
+ ((value[0] == 'AND') || (value[0] == 'OR')) &&
18464
+ this.is_subdomain(value[1]) &&
18465
+ (value[0] == value[1][0])) {
18467
18466
  value = this.simplify(value[1]).concat([value[2]]);
18468
18467
  }
18469
18468
  return value.map(this.simplify.bind(this));
@@ -21270,7 +21269,7 @@ function eval_pyson(value){
21270
21269
  var node = jQuery('<li/>', {
21271
21270
  'field': field,
21272
21271
  }).text(el_field.attr('name')).click(function(e) {
21273
- if (e.ctrlKey) {
21272
+ if (e.ctrlKey || e.metaKey) {
21274
21273
  node.toggleClass('bg-primary');
21275
21274
  } else {
21276
21275
  jQuery(e.target).addClass('bg-primary')
@@ -21294,7 +21293,7 @@ function eval_pyson(value){
21294
21293
  'field': parent_node[field].field,
21295
21294
  'name': parent_node[field].name
21296
21295
  }).text(name).click(function(e) {
21297
- if(e.ctrlKey) {
21296
+ if (e.ctrlKey || e.metaKey) {
21298
21297
  node.toggleClass('bg-primary');
21299
21298
  } else {
21300
21299
  this.fields_all.find('li').removeClass('bg-primary');
@@ -21589,7 +21588,7 @@ function eval_pyson(value){
21589
21588
  var node = jQuery('<li/>', {
21590
21589
  'path': path
21591
21590
  }).text(parent_node[name].string).click(function(e) {
21592
- if(e.ctrlKey) {
21591
+ if (e.ctrlKey || e.metaKey) {
21593
21592
  node.toggleClass('bg-primary');
21594
21593
  } else {
21595
21594
  this.fields_all.find('li')
@@ -21867,7 +21866,7 @@ function eval_pyson(value){
21867
21866
  var node = jQuery('<li/>', {
21868
21867
  'path': name,
21869
21868
  }).text(long_string).click(function(e) {
21870
- if(e.ctrlKey) {
21869
+ if (e.ctrlKey || e.metaKey) {
21871
21870
  node.toggleClass('bg-primary');
21872
21871
  } else {
21873
21872
  jQuery(e.target).addClass('bg-primary')
@@ -22759,6 +22758,9 @@ SOFTWARE.
22759
22758
  }
22760
22759
  } else {
22761
22760
  new_node = document.createDocumentFragment();
22761
+ if (node.tagName != 'SCRIPT') {
22762
+ new_node.textContent = node.textContent;
22763
+ }
22762
22764
  }
22763
22765
  return new_node;
22764
22766
  }