tryton-sao 7.0.48 → 7.0.49

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,9 @@
1
1
 
2
+ Version 7.0.49 - 2026-05-02
3
+ ---------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
2
7
  Version 7.0.48 - 2026-04-16
3
8
  ---------------------------
4
9
  * Bug fixes (see mercurial logs for details)
@@ -9434,12 +9434,10 @@ html.accesskey *[accesskey]:after {
9434
9434
  padding: 0 2px;
9435
9435
  position: absolute;
9436
9436
  text-transform: uppercase;
9437
- margin: 0 -1em;
9437
+ left: -1em;
9438
+ right: 0;
9438
9439
  z-index: 5;
9439
9440
  }
9440
- html.accesskey input[accesskey][type="checkbox"]:after {
9441
- background-color: initial;
9442
- }
9443
9441
  html.accesskey *[accesskey] ~ span[data-accesskey] {
9444
9442
  float: right;
9445
9443
  position: relative;
@@ -9450,10 +9448,13 @@ html.accesskey *[accesskey] ~ span[data-accesskey]:after {
9450
9448
  html.accesskey *[accesskey]:after {
9451
9449
  content: attr(accesskey);
9452
9450
  }
9453
- html.accesskey input[accesskey][type="checkbox"] ~ span[data-accesskey],
9454
- html.accesskey input[accesskey][type="checkbox"] ~ span[data-accesskey],
9455
- html.accesskey select[accesskey] ~ span[data-accesskey] {
9456
- bottom: 1em;
9451
+ html.accesskey[dir="rtl"] *[accesskey] ~ span[data-accesskey]:after,
9452
+ html.accesskey[dir="rtl"] *[accesskey]:after {
9453
+ left: 0;
9454
+ right: -1em;
9455
+ }
9456
+ html.accesskey[dir="rtl"] *[accesskey] ~ span[data-accesskey] {
9457
+ float: left;
9457
9458
  }
9458
9459
  .tab-form,
9459
9460
  .tab-board {
@@ -3,7 +3,7 @@
3
3
 
4
4
  /* eslint-disable no-redeclare */
5
5
  var Sao = {
6
- __version__: '7.0.48',
6
+ __version__: '7.0.49',
7
7
  };
8
8
  /* eslint-enable no-redeclare */
9
9
 
@@ -8622,7 +8622,7 @@ var Sao = {
8622
8622
  this.group.parent.id;
8623
8623
  }
8624
8624
  }
8625
- return this.set_default(values);
8625
+ return this.set_default(values).then(() => values);
8626
8626
  });
8627
8627
  }
8628
8628
  return jQuery.when();
@@ -10633,6 +10633,7 @@ var Sao = {
10633
10633
  this.name = '';
10634
10634
  this.name_el = jQuery('<span/>');
10635
10635
  this.view_prm = jQuery.when();
10636
+ this._action_running = false;
10636
10637
  },
10637
10638
  menu_def: function() {
10638
10639
  return [
@@ -10773,8 +10774,13 @@ var Sao = {
10773
10774
  this.menu_buttons[item.id] = menuitem;
10774
10775
  link.click(evt => {
10775
10776
  evt.preventDefault();
10776
- if (!menuitem.hasClass('disabled')) {
10777
- this[item.id]();
10777
+ if (!menuitem.hasClass('disabled')
10778
+ && !this._action_running) {
10779
+ this._action_running = true;
10780
+ (this[item.id]() || jQuery.when())
10781
+ .always(() => {
10782
+ this._action_running = false;
10783
+ });
10778
10784
  }
10779
10785
  });
10780
10786
  } else if (!item && previous) {
@@ -10874,17 +10880,14 @@ var Sao = {
10874
10880
  }
10875
10881
  this.buttons[item.id].click(item, event => {
10876
10882
  var item = event.data;
10877
- var button = this.buttons[item.id];
10878
- // Use data instead of disabled prop because the action may
10879
- // actually disable the button.
10880
- if (button.data('disabled')) {
10883
+ if (this._action_running) {
10881
10884
  event.preventDefault();
10882
10885
  return;
10883
10886
  }
10884
- button.data('disabled', true);
10887
+ this._action_running = true;
10885
10888
  (this[item.id](this) || jQuery.when())
10886
- .always(function() {
10887
- button.data('disabled', false);
10889
+ .always(() => {
10890
+ this._action_running = false;
10888
10891
  });
10889
10892
  });
10890
10893
  };
@@ -11458,7 +11461,7 @@ var Sao = {
11458
11461
  } else {
11459
11462
  prm = jQuery.when();
11460
11463
  }
11461
- prm.then(() => {
11464
+ return prm.then(() => {
11462
11465
  var access = Sao.common.MODELACCESS.get(this.screen.model_name);
11463
11466
  if (this.screen.readonly || !(access.write || access.create)) {
11464
11467
  return jQuery.Deferred().reject();
@@ -11560,18 +11563,18 @@ var Sao = {
11560
11563
  },
11561
11564
  previous: function() {
11562
11565
  return this.modified_save().then(() => {
11563
- var prm = this.screen.display_previous();
11564
- this.info_bar.clear();
11565
- this.set_buttons_sensitive();
11566
- return prm;
11566
+ return this.screen.display_previous().then(() => {
11567
+ this.info_bar.clear();
11568
+ this.set_buttons_sensitive();
11569
+ });
11567
11570
  });
11568
11571
  },
11569
11572
  next: function() {
11570
11573
  return this.modified_save().then(() => {
11571
- var prm = this.screen.display_next();
11572
- this.info_bar.clear();
11573
- this.set_buttons_sensitive();
11574
- return prm;
11574
+ return this.screen.display_next().then(() => {
11575
+ this.info_bar.clear();
11576
+ this.set_buttons_sensitive();
11577
+ });
11575
11578
  });
11576
11579
  },
11577
11580
  search: function() {
@@ -15180,7 +15183,8 @@ function eval_pyson(value){
15180
15183
  }
15181
15184
  }
15182
15185
  return jQuery.when.apply(jQuery,promesses)
15183
- .done(() => {
15186
+ .then(() => {
15187
+ let promesses = [];
15184
15188
  var record = this.record;
15185
15189
  for (const name in this.widgets) {
15186
15190
  var widgets = this.widgets[name];
@@ -15192,10 +15196,12 @@ function eval_pyson(value){
15192
15196
  field.set_state(record);
15193
15197
  }
15194
15198
  for (const widget of widgets) {
15195
- widget.display();
15199
+ let prm = widget.display();
15200
+ if (prm) {
15201
+ promesses.push(prm);
15202
+ }
15196
15203
  }
15197
15204
  }
15198
- var promesses = [];
15199
15205
  for (const j in this.state_widgets) {
15200
15206
  var state_widget = this.state_widgets[j];
15201
15207
  var prm = state_widget.set_state(record);
@@ -15208,7 +15214,7 @@ function eval_pyson(value){
15208
15214
  }
15209
15215
  // re-set the grid templates for the StateWidget that are
15210
15216
  // asynchronous
15211
- jQuery.when.apply(jQuery, promesses).done(() => {
15217
+ return jQuery.when.apply(jQuery, promesses).then(() => {
15212
15218
  for (const container of this.containers) {
15213
15219
  container.set_grid_template();
15214
15220
  }
@@ -16941,11 +16947,13 @@ function eval_pyson(value){
16941
16947
  this.el = jQuery('<div/>', {
16942
16948
  'class': this.class_
16943
16949
  });
16950
+ this.group = jQuery('<div/>', {
16951
+ 'class': 'input-group input-group-sm'
16952
+ }).css('width', '100%').appendTo(this.el);
16944
16953
  this.select = this.labelled = jQuery('<select/>', {
16945
16954
  'class': 'form-control input-sm mousetrap',
16946
16955
  'name': attributes.name,
16947
- });
16948
- this.el.append(this.select);
16956
+ }).appendTo(this.group);
16949
16957
  this.select.change(this.focus_out.bind(this));
16950
16958
  Sao.common.selection_mixin.init.call(this);
16951
16959
  this.init_selection();
@@ -17046,11 +17054,14 @@ function eval_pyson(value){
17046
17054
  this.el = jQuery('<div/>', {
17047
17055
  'class': this.class_
17048
17056
  });
17057
+ this.group = jQuery('<div/>', {
17058
+ 'class': 'input-group input-group-sm'
17059
+ }).css('width', '100%').appendTo(this.el);
17049
17060
  this.input = this.labelled = jQuery('<input/>', {
17050
17061
  'type': 'checkbox',
17051
17062
  'class': 'form-control input-sm mousetrap',
17052
17063
  'name': attributes.name,
17053
- }).appendTo(this.el);
17064
+ }).appendTo(this.group);
17054
17065
  this.input.change(this.focus_out.bind(this));
17055
17066
  this.input.click(function() {
17056
17067
  // Dont trigger click if field is readonly as readonly has no
@@ -18245,7 +18256,7 @@ function eval_pyson(value){
18245
18256
  display: function() {
18246
18257
  Sao.View.Form.One2Many._super.display.call(this);
18247
18258
 
18248
- this.prm.done(() => {
18259
+ return this.prm.then(() => {
18249
18260
  this._set_button_sensitive();
18250
18261
 
18251
18262
  var record = this.record;
@@ -18255,8 +18266,7 @@ function eval_pyson(value){
18255
18266
  this.screen.new_group();
18256
18267
  this.screen.current_record = null;
18257
18268
  this.screen.group.parent = null;
18258
- this.screen.display();
18259
- return;
18269
+ return this.screen.display();
18260
18270
  }
18261
18271
 
18262
18272
  var new_group = record.field_get_client(this.field_name);
@@ -18285,13 +18295,13 @@ function eval_pyson(value){
18285
18295
  this.screen.domain = domain;
18286
18296
  }
18287
18297
  this.screen.size_limit = size_limit;
18288
- this.screen.display();
18289
18298
  if (this.attributes.height !== undefined) {
18290
18299
  this.content
18291
18300
  .find('.treeview,.list-form').first()
18292
18301
  .css('min-height', this.attributes.height + 'px')
18293
18302
  .css('max-height', this.attributes.height + 'px');
18294
18303
  }
18304
+ return this.screen.display();
18295
18305
  });
18296
18306
  },
18297
18307
  focus: function() {
@@ -18564,9 +18574,7 @@ function eval_pyson(value){
18564
18574
  return prm;
18565
18575
  },
18566
18576
  set_value: function() {
18567
- if (this.screen.modified()) { // TODO check if required
18568
- this.view.screen.record_modified(false);
18569
- }
18577
+ this.screen.current_view.set_value();
18570
18578
  },
18571
18579
  _update_completion: function(text) {
18572
18580
  if (!this.record) {
@@ -18770,7 +18778,7 @@ function eval_pyson(value){
18770
18778
  display: function() {
18771
18779
  Sao.View.Form.Many2Many._super.display.call(this);
18772
18780
 
18773
- this.prm.done(() => {
18781
+ return this.prm.then(() => {
18774
18782
  var record = this.record;
18775
18783
  var field = this.field;
18776
18784
 
@@ -18778,20 +18786,19 @@ function eval_pyson(value){
18778
18786
  this.screen.new_group();
18779
18787
  this.screen.current_record = null;
18780
18788
  this.screen.group.parent = null;
18781
- this.screen.display();
18782
- return;
18789
+ return this.screen.display();
18783
18790
  }
18784
18791
  var new_group = record.field_get_client(this.field_name);
18785
18792
  if (new_group != this.screen.group) {
18786
18793
  this.screen.set_group(new_group);
18787
18794
  }
18788
- this.screen.display();
18789
18795
  if (this.attributes.height !== undefined) {
18790
18796
  this.content
18791
18797
  .find('.treeview,.list-form').first()
18792
18798
  .css('min-height', this.attributes.height + 'px')
18793
18799
  .css('max-height', this.attributes.height + 'px');
18794
18800
  }
18801
+ return this.screen.display();
18795
18802
  });
18796
18803
  },
18797
18804
  focus: function() {
@@ -22925,6 +22932,10 @@ function eval_pyson(value){
22925
22932
  fields, false, false, true)) {
22926
22933
  var value = cell.prop('checked');
22927
22934
  this.field.set_client(record, value);
22935
+ if (record !== current_record) {
22936
+ // we can not rely on editable tree handler to save the row
22937
+ record.save();
22938
+ }
22928
22939
  } else {
22929
22940
  evt.preventDefault();
22930
22941
  }
@@ -9434,12 +9434,10 @@ html.accesskey *[accesskey]:after {
9434
9434
  padding: 0 2px;
9435
9435
  position: absolute;
9436
9436
  text-transform: uppercase;
9437
- margin: 0 -1em;
9437
+ left: -1em;
9438
+ right: 0;
9438
9439
  z-index: 5;
9439
9440
  }
9440
- html.accesskey input[accesskey][type="checkbox"]:after {
9441
- background-color: initial;
9442
- }
9443
9441
  html.accesskey *[accesskey] ~ span[data-accesskey] {
9444
9442
  float: right;
9445
9443
  position: relative;
@@ -9450,10 +9448,13 @@ html.accesskey *[accesskey] ~ span[data-accesskey]:after {
9450
9448
  html.accesskey *[accesskey]:after {
9451
9449
  content: attr(accesskey);
9452
9450
  }
9453
- html.accesskey input[accesskey][type="checkbox"] ~ span[data-accesskey],
9454
- html.accesskey input[accesskey][type="checkbox"] ~ span[data-accesskey],
9455
- html.accesskey select[accesskey] ~ span[data-accesskey] {
9456
- bottom: 1em;
9451
+ html.accesskey[dir="rtl"] *[accesskey] ~ span[data-accesskey]:after,
9452
+ html.accesskey[dir="rtl"] *[accesskey]:after {
9453
+ left: 0;
9454
+ right: -1em;
9455
+ }
9456
+ html.accesskey[dir="rtl"] *[accesskey] ~ span[data-accesskey] {
9457
+ float: left;
9457
9458
  }
9458
9459
  .tab-form,
9459
9460
  .tab-board {