tryton-sao 7.0.0 → 7.0.2

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 7.0.2 - 2023-12-01
3
+ --------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
7
+ Version 7.0.1 - 2023-11-03
8
+ --------------------------
9
+ * Bug fixes (see mercurial logs for details)
10
+
11
+
2
12
  Version 7.0.0 - 2023-10-30
3
13
  --------------------------
4
14
  * Bug fixes (see mercurial logs for details)
@@ -9601,16 +9601,15 @@ img.icon {
9601
9601
  .treeview > table.tree col.tree-menu {
9602
9602
  width: 30px;
9603
9603
  }
9604
- .treeview > table.tree td.draggable-handle,
9605
- .treeview > table.tree td.optional {
9606
- cursor: grab;
9607
- }
9608
9604
  .treeview > table.tree td.draggable-handle > img,
9609
9605
  .treeview > table.tree td.optional > img {
9610
9606
  display: block;
9611
9607
  margin-right: auto;
9612
9608
  margin-left: auto;
9613
9609
  }
9610
+ .treeview > table.tree td.draggable-handle {
9611
+ cursor: grab;
9612
+ }
9614
9613
  .treeview > table.tree th.selection-state > input,
9615
9614
  .treeview > table.tree td.selection-state > input {
9616
9615
  display: block;
@@ -9793,12 +9792,13 @@ img.icon {
9793
9792
  }
9794
9793
  .treeview .expander > img {
9795
9794
  float: left;
9796
- margin-right: 5px;
9797
- width: 1em;
9795
+ margin-right: 1em;
9796
+ width: 1.42857143em;
9797
+ height: 1.42857143em;
9798
9798
  }
9799
9799
  [dir="rtl"] .treeview .expander > img {
9800
9800
  float: right;
9801
- margin-left: 5px;
9801
+ margin-left: 1em;
9802
9802
  }
9803
9803
  .treeview label {
9804
9804
  font-weight: normal;
@@ -1,7 +1,7 @@
1
1
  /* This file is part of Tryton. The COPYRIGHT file at the top level of
2
2
  this repository contains the full copyright notices and license terms. */
3
3
  var Sao = {
4
- __version__: '7.0.0',
4
+ __version__: '7.0.2',
5
5
  };
6
6
 
7
7
  (function() {
@@ -778,11 +778,14 @@ var Sao = {
778
778
 
779
779
  Sao.main_menu_row_activate = function() {
780
780
  var screen = Sao.main_menu_screen;
781
- // ids is not defined to prevent to add suffix
782
- return Sao.Action.exec_keyword('tree_open', {
783
- 'model': screen.model_name,
784
- 'id': screen.get_id(),
785
- }, null, false);
781
+ const id = screen.get_id();
782
+ if (id) {
783
+ // ids is not defined to prevent to add suffix
784
+ Sao.Action.exec_keyword('tree_open', {
785
+ 'model': screen.model_name,
786
+ 'id': screen.get_id(),
787
+ }, null, false);
788
+ }
786
789
  };
787
790
 
788
791
  Sao.menu = function(preferences) {
@@ -824,6 +827,7 @@ var Sao = {
824
827
  view.table.removeClass('table table-bordered');
825
828
  view.table.addClass('no-responsive');
826
829
  view.table.find('thead').hide();
830
+ view.table.find('colgroup > col.tree-menu').css('width', 0);
827
831
  var gs = new Sao.GlobalSearch();
828
832
  jQuery('#global-search').empty();
829
833
  jQuery('#global-search').append(gs.el);
@@ -2736,7 +2740,7 @@ var Sao = {
2736
2740
  'sao_device_cookies', JSON.stringify(device_cookies));
2737
2741
  });
2738
2742
  renew_prm.fail(() => {
2739
- Sao.error("Cannot renew device cookie");
2743
+ Sao.Logger.error("Cannot renew device cookie");
2740
2744
  });
2741
2745
  }
2742
2746
  });
@@ -6371,7 +6375,7 @@ var Sao = {
6371
6375
  return img_url;
6372
6376
  })
6373
6377
  .fail(() => {
6374
- Sao.error("Unknown icon %s", icon_name);
6378
+ Sao.Logger.error("Unknown icon %s", icon_name);
6375
6379
  });
6376
6380
  }
6377
6381
  });
@@ -13608,11 +13612,14 @@ var Sao = {
13608
13612
  default_row_activate: function() {
13609
13613
  if ((this.current_view.view_type == 'tree') &&
13610
13614
  (this.current_view.attributes.keyword_open == 1)) {
13611
- Sao.Action.exec_keyword('tree_open', {
13612
- 'model': this.model_name,
13613
- 'id': this.get_id(),
13614
- 'ids': [this.get_id()]
13615
- }, this.local_context, false);
13615
+ const id = this.get_id();
13616
+ if (id) {
13617
+ Sao.Action.exec_keyword('tree_open', {
13618
+ 'model': this.model_name,
13619
+ 'id': this.get_id(),
13620
+ 'ids': [this.get_id()]
13621
+ }, this.local_context, false);
13622
+ }
13616
13623
  } else {
13617
13624
  if (!this.modified()) {
13618
13625
  this.switch_view('form');
@@ -14987,7 +14994,9 @@ function eval_pyson(value){
14987
14994
  if (record) {
14988
14995
  return record.on_scan_code(
14989
14996
  code, this.attributes.scan_code_depends || []).done(() => {
14990
- this.el.parents('form').submit();
14997
+ if (this.attributes.scan_code == 'submit') {
14998
+ this.el.parents('form').submit();
14999
+ }
14991
15000
  });
14992
15001
  } else {
14993
15002
  return jQuery.when();
@@ -15467,7 +15476,7 @@ function eval_pyson(value){
15467
15476
  hide: function() {
15468
15477
  Sao.View.Form.Page._super.hide.call(this);
15469
15478
  if (this.el.hasClass('active')) {
15470
- this.el.next(':visible').find('a').tab('show');
15479
+ this.el.siblings(':visible').first().find('a').tab('show');
15471
15480
  }
15472
15481
  }
15473
15482
  });
@@ -17890,7 +17899,7 @@ function eval_pyson(value){
17890
17899
  },
17891
17900
  set_readonly: function(readonly) {
17892
17901
  Sao.View.Form.One2Many._super.set_readonly.call(this, readonly);
17893
- this._set_button_sensitive();
17902
+ this.prm.done(() => this._set_button_sensitive());
17894
17903
  this._set_label_state();
17895
17904
  },
17896
17905
  set_required: function(required) {
@@ -17978,9 +17987,9 @@ function eval_pyson(value){
17978
17987
  display: function() {
17979
17988
  Sao.View.Form.One2Many._super.display.call(this);
17980
17989
 
17981
- this._set_button_sensitive();
17982
-
17983
17990
  this.prm.done(() => {
17991
+ this._set_button_sensitive();
17992
+
17984
17993
  var record = this.record;
17985
17994
  var field = this.field;
17986
17995
 
@@ -18273,7 +18282,7 @@ function eval_pyson(value){
18273
18282
  }
18274
18283
  var message = name + ' / ' + Sao.common.humanize(size);
18275
18284
  this.label.text(message).attr('title', message);
18276
- this._set_button_sensitive();
18285
+ this.prm.done(() => this._set_button_sensitive());
18277
18286
  },
18278
18287
  validate: function() {
18279
18288
  var prm = jQuery.Deferred();
@@ -21590,6 +21599,11 @@ function eval_pyson(value){
21590
21599
  this.expander.children().html(' ');
21591
21600
  this.expander.on('click keypress',
21592
21601
  Sao.common.click_press(this.toggle_row.bind(this)));
21602
+ this.expander.dblclick((evt) => {
21603
+ // prevent calling switch_row on td
21604
+ evt.preventDefault();
21605
+ evt.stopImmediatePropagation();
21606
+ });
21593
21607
  }
21594
21608
 
21595
21609
  for (var i = 0; i < this.tree.columns.length; i++) {
@@ -9601,16 +9601,15 @@ img.icon {
9601
9601
  .treeview > table.tree col.tree-menu {
9602
9602
  width: 30px;
9603
9603
  }
9604
- .treeview > table.tree td.draggable-handle,
9605
- .treeview > table.tree td.optional {
9606
- cursor: grab;
9607
- }
9608
9604
  .treeview > table.tree td.draggable-handle > img,
9609
9605
  .treeview > table.tree td.optional > img {
9610
9606
  display: block;
9611
9607
  margin-right: auto;
9612
9608
  margin-left: auto;
9613
9609
  }
9610
+ .treeview > table.tree td.draggable-handle {
9611
+ cursor: grab;
9612
+ }
9614
9613
  .treeview > table.tree th.selection-state > input,
9615
9614
  .treeview > table.tree td.selection-state > input {
9616
9615
  display: block;
@@ -9793,12 +9792,13 @@ img.icon {
9793
9792
  }
9794
9793
  .treeview .expander > img {
9795
9794
  float: left;
9796
- margin-right: 5px;
9797
- width: 1em;
9795
+ margin-right: 1em;
9796
+ width: 1.42857143em;
9797
+ height: 1.42857143em;
9798
9798
  }
9799
9799
  [dir="rtl"] .treeview .expander > img {
9800
9800
  float: right;
9801
- margin-left: 5px;
9801
+ margin-left: 1em;
9802
9802
  }
9803
9803
  .treeview label {
9804
9804
  font-weight: normal;