tryton-sao 6.2.3 → 6.2.4

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,6 @@
1
+ Version 6.2.4 - 2022-02-01
2
+ * Bug fixes (see mercurial logs for details)
3
+
1
4
  Version 6.2.3 - 2022-01-15
2
5
  * Bug fixes (see mercurial logs for details)
3
6
 
package/COPYRIGHT CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (C) 2012-2021 Nicolas Évrard.
1
+ Copyright (C) 2012-2022 Nicolas Évrard.
2
2
  Copyright (C) 2012-2022 Cédric Krier.
3
3
  Copyright (C) 2012-2014 Bertrand Chenal.
4
4
  Copyright (C) 2012-2022 B2CK SPRL.
@@ -1673,7 +1673,7 @@ var Sao = {};
1673
1673
 
1674
1674
  Sao.PYSON.Eval.eval_ = function(value, context) {
1675
1675
  var idx = value.v.indexOf('.');
1676
- if (idx >= 0) {
1676
+ if ((idx >= 0) && !(value.v in context)) {
1677
1677
  return Sao.PYSON.Eval.eval_({
1678
1678
  'v': value.v.substring(idx + 1),
1679
1679
  'd': value.d,
@@ -19600,6 +19600,23 @@ function eval_pyson(value){
19600
19600
  this.table.append(this.tfoot);
19601
19601
  }
19602
19602
 
19603
+ if (this.children_field) {
19604
+ this.expander = jQuery('<span/>', {
19605
+ 'class': 'expander',
19606
+ }).append(jQuery('<img/>', {
19607
+ 'tabindex': 0,
19608
+ 'class': 'icon',
19609
+ }));
19610
+ this.update_expander('more');
19611
+ this.expander.on('click keypress',
19612
+ Sao.common.click_press(this.unfold.bind(this)));
19613
+ Sao.common.ICONFACTORY.get_icon_url(
19614
+ 'tryton-unfold-' + this.expander.action)
19615
+ .then(function(url) {
19616
+ this.expander.children().attr('src', url);
19617
+ }.bind(this));
19618
+ }
19619
+
19603
19620
  this.columns.forEach(function(column, i) {
19604
19621
  col = jQuery('<col/>', {
19605
19622
  'class': column.attributes.widget,
@@ -19607,23 +19624,6 @@ function eval_pyson(value){
19607
19624
  th = jQuery('<th/>', {
19608
19625
  'class': column.attributes.widget,
19609
19626
  });
19610
- if ((i === 0) && this.children_field) {
19611
- this.expander = jQuery('<img/>', {
19612
- 'tabindex': 0,
19613
- 'class': 'icon',
19614
- });
19615
- this.update_expander('more');
19616
- this.expander.on('click keypress',
19617
- Sao.common.click_press(this.unfold.bind(this)));
19618
- Sao.common.ICONFACTORY.get_icon_url(
19619
- 'tryton-unfold-' + this.expander.action)
19620
- .then(function(url) {
19621
- this.expander.attr('src', url);
19622
- }.bind(this));
19623
- th.append(jQuery('<span>', {
19624
- 'class': 'expander',
19625
- }).append(this.expander));
19626
- }
19627
19627
  var label = jQuery('<label/>')
19628
19628
  .text(column.attributes.string)
19629
19629
  .attr('title', column.attributes.string);
@@ -19714,7 +19714,7 @@ function eval_pyson(value){
19714
19714
  Sao.common.ICONFACTORY.get_icon_url(
19715
19715
  'tryton-unfold-' + this.expander.action)
19716
19716
  .then(function(url) {
19717
- this.expander.attr('src', url);
19717
+ this.expander.children().attr('src', url);
19718
19718
  }.bind(this));
19719
19719
  if (jQuery.isEmptyObject(this.selected_records)) {
19720
19720
  this.expander.css('visibility', 'hidden');
@@ -20156,8 +20156,8 @@ function eval_pyson(value){
20156
20156
  !column.col.hasClass('selection-state') &&
20157
20157
  !column.col.hasClass('favorite')) {
20158
20158
  var width, c_width;
20159
- if (column.width) {
20160
- width = c_width = column.width;
20159
+ if (column.attributes.width) {
20160
+ width = c_width = column.attributes.width;
20161
20161
  min_width.push(width + 'px');
20162
20162
  } else {
20163
20163
  width = {
@@ -20184,6 +20184,19 @@ function eval_pyson(value){
20184
20184
  column.col.show();
20185
20185
  }
20186
20186
  }.bind(this));
20187
+ if (this.children_field) {
20188
+ this.columns.every(function(column) {
20189
+ if (column.col.hasClass('draggable-handle') ||
20190
+ column.header.hasClass('invisible')) {
20191
+ return true;
20192
+ } else {
20193
+ if (this.expander.parent()[0] !== column.header[0]) {
20194
+ column.header.prepend(this.expander);
20195
+ }
20196
+ return false;
20197
+ }
20198
+ }.bind(this));
20199
+ }
20187
20200
  this.table.css('min-width', 'calc(' + min_width.join(' + ') + ')');
20188
20201
  this.scrollbar.css('min-width', this.table.css('min-width'));
20189
20202
  this.tbody.find('tr.more-row > td').attr(
@@ -20779,6 +20792,18 @@ function eval_pyson(value){
20779
20792
  this.select_column(event_.data.index);
20780
20793
  }.bind(this);
20781
20794
 
20795
+ if (this.children_field) {
20796
+ this.expander = jQuery('<span/>', {
20797
+ 'class': 'expander',
20798
+ }).append('<img/>', {
20799
+ 'tabindex': 0,
20800
+ 'class': 'icon',
20801
+ });
20802
+ this.expander.children().html('&nbsp;');
20803
+ this.expander.on('click keypress',
20804
+ Sao.common.click_press(this.toggle_row.bind(this)));
20805
+ }
20806
+
20782
20807
  for (var i = 0; i < this.tree.columns.length; i++) {
20783
20808
  var column = this.tree.columns[i];
20784
20809
  if (column instanceof Sao.View.Tree.ButtonColumn) {
@@ -20806,18 +20831,6 @@ function eval_pyson(value){
20806
20831
  'class': 'cell',
20807
20832
  });
20808
20833
  td.append(cell);
20809
- if ((i === 0) && this.children_field) {
20810
- this.expander = jQuery('<img/>', {
20811
- 'tabindex': 0,
20812
- 'class': 'icon',
20813
- });
20814
- this.expander.html('&nbsp;');
20815
- this.expander.on('click keypress',
20816
- Sao.common.click_press(this.toggle_row.bind(this)));
20817
- cell.append(jQuery('<span/>', {
20818
- 'class': 'expander'
20819
- }).append(this.expander));
20820
- }
20821
20834
  var j;
20822
20835
  if (column.prefixes) {
20823
20836
  for (j = 0; j < column.prefixes.length; j++) {
@@ -20930,6 +20943,21 @@ function eval_pyson(value){
20930
20943
  }
20931
20944
  }
20932
20945
  }
20946
+ if (this.children_field) {
20947
+ this.tree.columns.every(function(column, i) {
20948
+ if (column.col.hasClass('draggable-handle') ||
20949
+ column.header.hasClass('invisible')) {
20950
+ return true;
20951
+ } else {
20952
+ var td = this._get_column_td(i);
20953
+ var cell = td.find('.cell');
20954
+ if (this.expander.parent()[0] !== cell[0]) {
20955
+ cell.prepend(this.expander);
20956
+ }
20957
+ return false;
20958
+ }
20959
+ }.bind(this));
20960
+ }
20933
20961
  this._drawed_record = this.record.identity;
20934
20962
 
20935
20963
  var row_id_path = this.get_id_path();
@@ -20940,7 +20968,7 @@ function eval_pyson(value){
20940
20968
  if (Sao.i18n.rtl) {
20941
20969
  margin = 'margin-right';
20942
20970
  }
20943
- this.expander.css(margin, (depth - 1) + 'em');
20971
+ this.expander.children().css(margin, (depth - 1) + 'em');
20944
20972
 
20945
20973
  var update_expander = function() {
20946
20974
  var length = this.record.field_get_client(
@@ -21004,7 +21032,7 @@ function eval_pyson(value){
21004
21032
  }
21005
21033
  Sao.common.ICONFACTORY.get_icon_url(icon)
21006
21034
  .then(function(url) {
21007
- this.expander.attr('src', url);
21035
+ this.expander.children().attr('src', url);
21008
21036
  }.bind(this));
21009
21037
  },
21010
21038
  collapse_children: function() {