tryton-sao 7.0.13 → 7.0.15

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.15 - 2024-08-01
3
+ ---------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
7
+ Version 7.0.14 - 2024-07-17
8
+ ---------------------------
9
+ * Bug fixes (see mercurial logs for details)
10
+
11
+
2
12
  Version 7.0.13 - 2024-07-01
3
13
  ---------------------------
4
14
  * Bug fixes (see mercurial logs for details)
@@ -3,7 +3,7 @@
3
3
 
4
4
  /* eslint-disable no-redeclare */
5
5
  var Sao = {
6
- __version__: '7.0.13',
6
+ __version__: '7.0.15',
7
7
  };
8
8
  /* eslint-enable no-redeclare */
9
9
 
@@ -10407,12 +10407,11 @@ var Sao = {
10407
10407
  Sao.field.Dict._super.set.call(this, record, value);
10408
10408
  },
10409
10409
  get: function(record) {
10410
- return (Sao.field.Dict._super.get.call(this, record) ||
10411
- this._default);
10410
+ return jQuery.extend(
10411
+ {}, Sao.field.Dict._super.get.call(this, record));
10412
10412
  },
10413
10413
  get_client: function(record) {
10414
- return (Sao.field.Dict._super.get_client.call(this, record) ||
10415
- this._default);
10414
+ return Sao.field.Dict._super.get_client.call(this, record);
10416
10415
  },
10417
10416
  validation_domains: function(record, pre_validate) {
10418
10417
  return this.get_domains(record, pre_validate)[0];
@@ -10656,7 +10655,9 @@ var Sao = {
10656
10655
  this.menu_buttons[item.id] = menuitem;
10657
10656
  link.click(evt => {
10658
10657
  evt.preventDefault();
10659
- this[item.id]();
10658
+ if (!menuitem.hasClass('disabled')) {
10659
+ this[item.id]();
10660
+ }
10660
10661
  });
10661
10662
  } else if (!item && previous) {
10662
10663
  menuitem = jQuery('<li/>', {
@@ -19860,7 +19861,9 @@ function eval_pyson(value){
19860
19861
  return value.map(function(e) { return JSON.parse(e); });
19861
19862
  },
19862
19863
  set_value: function(value) {
19863
- value = value.map(function(e) { return JSON.stringify(e); });
19864
+ if (value) {
19865
+ value = value.map(function(e) { return JSON.stringify(e); });
19866
+ }
19864
19867
  this.input.val(value);
19865
19868
  }
19866
19869
  });
@@ -21093,6 +21096,7 @@ function eval_pyson(value){
21093
21096
  }).map(function(row) {
21094
21097
  return row.el;
21095
21098
  }));
21099
+ this.update_selection(); // update after new rows has been added
21096
21100
  if ((this.display_size < this.group.length) &&
21097
21101
  (!this.tbody.children().last().hasClass('more-row'))) {
21098
21102
  var more_row = jQuery('<tr/>', {
@@ -21157,9 +21161,7 @@ function eval_pyson(value){
21157
21161
  }
21158
21162
  },
21159
21163
  redraw: function(selected, expanded) {
21160
- return redraw_async(this.rows, selected, expanded).then(() => {
21161
- this.update_selection();
21162
- });
21164
+ return redraw_async(this.rows, selected, expanded);
21163
21165
  },
21164
21166
  switch_: function(path) {
21165
21167
  this.screen.row_activate();
@@ -21384,9 +21386,9 @@ function eval_pyson(value){
21384
21386
  this.selection.prop('indeterminate', false);
21385
21387
  if (jQuery.isEmptyObject(selected_records)) {
21386
21388
  this.selection.prop('checked', false);
21387
- } else if (selected_records.length ==
21388
- this.tbody.children().length &&
21389
- this.display_size >= this.group.length) {
21389
+ } else if (
21390
+ this.rows.every((row) => row.is_selected()) &&
21391
+ (selected_records.length >= this.tbody.children().length)) {
21390
21392
  this.selection.prop('checked', true);
21391
21393
  } else {
21392
21394
  this.selection.prop('indeterminate', true);
@@ -21486,7 +21488,10 @@ function eval_pyson(value){
21486
21488
  if (this.editable && new_) {
21487
21489
  td.trigger('click');
21488
21490
  }
21489
- Sao.common.find_focusable_child(td).focus();
21491
+ var child = Sao.common.find_focusable_child(td);
21492
+ if (child) {
21493
+ child.focus();
21494
+ }
21490
21495
  }
21491
21496
  }
21492
21497
  };
@@ -25474,8 +25479,14 @@ function eval_pyson(value){
25474
25479
  this.title = title;
25475
25480
  this.exclude_field = kwargs.exclude_field || null;
25476
25481
  var dialog = new Sao.Dialog(Sao.i18n.gettext(
25477
- 'Search %1', this.title), '', 'lg');
25482
+ 'Search %1', this.title), '', 'lg', false);
25478
25483
  this.el = dialog.modal;
25484
+ this.el.on('keydown', e => {
25485
+ if (e.which == Sao.common.ESC_KEYCODE) {
25486
+ e.preventDefault();
25487
+ this.response('RESPONSE_CANCEL');
25488
+ }
25489
+ });
25479
25490
 
25480
25491
  jQuery('<button/>', {
25481
25492
  'class': 'btn btn-link',
@@ -25551,7 +25562,8 @@ function eval_pyson(value){
25551
25562
  if (response_id == 'RESPONSE_OK') {
25552
25563
  records = this.screen.current_view.selected_records;
25553
25564
  } else if (response_id == 'RESPONSE_APPLY') {
25554
- this.screen.search_filter();
25565
+ this.screen.search_filter(
25566
+ this.screen.screen_container.get_text());
25555
25567
  return;
25556
25568
  } else if (response_id == 'RESPONSE_ACCEPT') {
25557
25569
  var view_ids = jQuery.extend([], this.view_ids);
@@ -27619,7 +27631,8 @@ function eval_pyson(value){
27619
27631
  }
27620
27632
  if (!dialog ||
27621
27633
  !this.model ||
27622
- (Sao.main_menu_screen.model_name == this.model)) {
27634
+ (Sao.main_menu_screen &&
27635
+ (Sao.main_menu_screen.model_name == this.model))) {
27623
27636
  is_menu = true;
27624
27637
  screen = Sao.main_menu_screen;
27625
27638
  } else {