tryton-sao 7.2.3 → 7.2.5

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.2.5 - 2024-08-01
3
+ --------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
7
+ Version 7.2.4 - 2024-07-17
8
+ --------------------------
9
+ * Bug fixes (see mercurial logs for details)
10
+
11
+
2
12
  Version 7.2.3 - 2024-07-01
3
13
  --------------------------
4
14
  * Bug fixes (see mercurial logs for details)
@@ -9342,12 +9342,6 @@ html[theme="default"] .carousel-caption h6 {
9342
9342
  display: flex;
9343
9343
  flex: 1;
9344
9344
  }
9345
- @media screen and (max-width: 767px) {
9346
- #tabcontent > .tab-pane > .panel > .panel-body {
9347
- flex-direction: column-reverse;
9348
- min-height: unset;
9349
- }
9350
- }
9351
9345
  #tabcontent[data-view-type="tree"] {
9352
9346
  display: flex;
9353
9347
  flex: 1;
@@ -9679,9 +9673,7 @@ img.icon {
9679
9673
  border-style: solid;
9680
9674
  border-width: 0 0 0 1px;
9681
9675
  flex: 1;
9682
- margin-left: 5px;
9683
- min-width: 20%;
9684
- overflow: auto;
9676
+ overflow: unset;
9685
9677
  }
9686
9678
  .attachment-preview > div {
9687
9679
  flex: 1;
@@ -9691,8 +9683,10 @@ img.icon {
9691
9683
  }
9692
9684
  @media screen and (max-width: 991px) {
9693
9685
  .attachment-preview:not(:empty) {
9694
- border-width: 0 0 1px 0;
9695
- margin-bottom: 5px;
9686
+ flex: 2;
9687
+ }
9688
+ .attachment-preview:not(:empty) > div.preview-resizer {
9689
+ resize: none;
9696
9690
  }
9697
9691
  }
9698
9692
  .list-form {
@@ -10340,8 +10334,8 @@ input.column-boolean {
10340
10334
  float: none;
10341
10335
  }
10342
10336
  @media screen and (max-width: 767px) {
10343
- .treeview {
10344
- height: calc(100vh - 370px);
10337
+ .dict-row {
10338
+ grid-column: 1;
10345
10339
  }
10346
10340
  .dict-label {
10347
10341
  text-align: left;
@@ -3,7 +3,7 @@
3
3
 
4
4
  /* eslint-disable no-redeclare */
5
5
  var Sao = {
6
- __version__: '7.2.3',
6
+ __version__: '7.2.5',
7
7
  };
8
8
  /* eslint-enable no-redeclare */
9
9
 
@@ -10544,12 +10544,11 @@ var Sao = {
10544
10544
  Sao.field.Dict._super.set.call(this, record, value);
10545
10545
  },
10546
10546
  get: function(record) {
10547
- return (Sao.field.Dict._super.get.call(this, record) ||
10548
- this._default);
10547
+ return jQuery.extend(
10548
+ {}, Sao.field.Dict._super.get.call(this, record));
10549
10549
  },
10550
10550
  get_client: function(record) {
10551
- return (Sao.field.Dict._super.get_client.call(this, record) ||
10552
- this._default);
10551
+ return Sao.field.Dict._super.get_client.call(this, record);
10553
10552
  },
10554
10553
  validation_domains: function(record, pre_validate) {
10555
10554
  return this.get_domains(record, pre_validate)[0];
@@ -10797,7 +10796,9 @@ var Sao = {
10797
10796
  this.menu_buttons[item.id] = menuitem;
10798
10797
  link.click(evt => {
10799
10798
  evt.preventDefault();
10800
- this[item.id]();
10799
+ if (!menuitem.hasClass('disabled')) {
10800
+ this[item.id]();
10801
+ }
10801
10802
  });
10802
10803
  } else if (!item && previous) {
10803
10804
  menuitem = jQuery('<li/>', {
@@ -19842,6 +19843,7 @@ function eval_pyson(value){
19842
19843
  for (const key of new_names) {
19843
19844
  value[key] = null;
19844
19845
  }
19846
+ this.field.set_client(this.record, value);
19845
19847
  this._display().then(() => {
19846
19848
  this.fields[new_names[0]].input.focus();
19847
19849
  });
@@ -20224,7 +20226,9 @@ function eval_pyson(value){
20224
20226
  return value.map(function(e) { return JSON.parse(e); });
20225
20227
  },
20226
20228
  set_value: function(value) {
20227
- value = value.map(function(e) { return JSON.stringify(e); });
20229
+ if (value) {
20230
+ value = value.map(function(e) { return JSON.stringify(e); });
20231
+ }
20228
20232
  this.input.val(value);
20229
20233
  }
20230
20234
  });
@@ -21421,6 +21425,7 @@ function eval_pyson(value){
21421
21425
  }).map(function(row) {
21422
21426
  return row.el;
21423
21427
  }));
21428
+ this.update_selection(); // update after new rows has been added
21424
21429
  if ((this.display_size < this.group.length) &&
21425
21430
  (!this.tbody.children().last().hasClass('more-row'))) {
21426
21431
  var more_row = jQuery('<tr/>', {
@@ -21485,9 +21490,7 @@ function eval_pyson(value){
21485
21490
  }
21486
21491
  },
21487
21492
  redraw: function(selected, expanded) {
21488
- return redraw_async(this.rows, selected, expanded).then(() => {
21489
- this.update_selection();
21490
- });
21493
+ return redraw_async(this.rows, selected, expanded);
21491
21494
  },
21492
21495
  switch_: function(path) {
21493
21496
  this.screen.row_activate();
@@ -21712,9 +21715,9 @@ function eval_pyson(value){
21712
21715
  this.selection.prop('indeterminate', false);
21713
21716
  if (jQuery.isEmptyObject(selected_records)) {
21714
21717
  this.selection.prop('checked', false);
21715
- } else if (selected_records.length ==
21716
- this.tbody.children().length &&
21717
- this.display_size >= this.group.length) {
21718
+ } else if (
21719
+ this.rows.every((row) => row.is_selected()) &&
21720
+ (selected_records.length >= this.tbody.children().length)) {
21718
21721
  this.selection.prop('checked', true);
21719
21722
  } else {
21720
21723
  this.selection.prop('indeterminate', true);
@@ -21814,7 +21817,10 @@ function eval_pyson(value){
21814
21817
  if (this.editable && new_) {
21815
21818
  td.trigger('click');
21816
21819
  }
21817
- Sao.common.find_focusable_child(td).focus();
21820
+ var child = Sao.common.find_focusable_child(td);
21821
+ if (child) {
21822
+ child.focus();
21823
+ }
21818
21824
  }
21819
21825
  }
21820
21826
  };
@@ -25827,8 +25833,14 @@ function eval_pyson(value){
25827
25833
  this.title = title;
25828
25834
  this.exclude_field = kwargs.exclude_field || null;
25829
25835
  var dialog = new Sao.Dialog(Sao.i18n.gettext(
25830
- 'Search %1', this.title), '', 'lg');
25836
+ 'Search %1', this.title), '', 'lg', false);
25831
25837
  this.el = dialog.modal;
25838
+ this.el.on('keydown', e => {
25839
+ if (e.which == Sao.common.ESC_KEYCODE) {
25840
+ e.preventDefault();
25841
+ this.response('RESPONSE_CANCEL');
25842
+ }
25843
+ });
25832
25844
 
25833
25845
  jQuery('<button/>', {
25834
25846
  'class': 'btn btn-link',
@@ -25904,7 +25916,8 @@ function eval_pyson(value){
25904
25916
  if (response_id == 'RESPONSE_OK') {
25905
25917
  records = this.screen.current_view.selected_records;
25906
25918
  } else if (response_id == 'RESPONSE_APPLY') {
25907
- this.screen.search_filter();
25919
+ this.screen.search_filter(
25920
+ this.screen.screen_container.get_text());
25908
25921
  return;
25909
25922
  } else if (response_id == 'RESPONSE_ACCEPT') {
25910
25923
  var view_ids = jQuery.extend([], this.view_ids);
@@ -27975,7 +27988,8 @@ function eval_pyson(value){
27975
27988
  }
27976
27989
  if (!dialog ||
27977
27990
  !this.model ||
27978
- (Sao.main_menu_screen.model_name == this.model)) {
27991
+ (Sao.main_menu_screen &&
27992
+ (Sao.main_menu_screen.model_name == this.model))) {
27979
27993
  is_menu = true;
27980
27994
  screen = Sao.main_menu_screen;
27981
27995
  } else {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "tryton-sao",
3
3
  "title": "sao",
4
4
  "description": "Tryton webclient",
5
- "version": "7.2.3",
5
+ "version": "7.2.5",
6
6
  "homepage": "http://www.tryton.org/",
7
7
  "author": {
8
8
  "name": "Tryton"
package/src/model.js CHANGED
@@ -2906,12 +2906,11 @@
2906
2906
  Sao.field.Dict._super.set.call(this, record, value);
2907
2907
  },
2908
2908
  get: function(record) {
2909
- return (Sao.field.Dict._super.get.call(this, record) ||
2910
- this._default);
2909
+ return jQuery.extend(
2910
+ {}, Sao.field.Dict._super.get.call(this, record));
2911
2911
  },
2912
2912
  get_client: function(record) {
2913
- return (Sao.field.Dict._super.get_client.call(this, record) ||
2914
- this._default);
2913
+ return Sao.field.Dict._super.get_client.call(this, record);
2915
2914
  },
2916
2915
  validation_domains: function(record, pre_validate) {
2917
2916
  return this.get_domains(record, pre_validate)[0];
package/src/sao.js CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  /* eslint-disable no-redeclare */
5
5
  var Sao = {
6
- __version__: '7.2.3',
6
+ __version__: '7.2.5',
7
7
  };
8
8
  /* eslint-enable no-redeclare */
9
9
 
package/src/sao.less CHANGED
@@ -266,15 +266,6 @@ html[theme="default"] {
266
266
  }
267
267
  }
268
268
 
269
- @media screen and (max-width: @screen-xs-max) {
270
- #tabcontent {
271
- > .tab-pane > .panel > .panel-body {
272
- flex-direction: column-reverse;
273
- min-height: unset;
274
- }
275
- }
276
- }
277
-
278
269
  #tabcontent[data-view-type="tree"] {
279
270
  display: flex;
280
271
  flex: 1;
@@ -545,9 +536,7 @@ img.icon {
545
536
  border-style: solid;
546
537
  border-width: 0 0 0 1px;
547
538
  flex: 1;
548
- margin-left: 5px;
549
- min-width: 20%;
550
- overflow: auto;
539
+ overflow: unset;
551
540
 
552
541
  > div {
553
542
  flex: 1;
@@ -560,8 +549,11 @@ img.icon {
560
549
 
561
550
  @media screen and (max-width: @screen-sm-max) {
562
551
  .attachment-preview:not(:empty) {
563
- border-width: 0 0 1px 0;
564
- margin-bottom: 5px;
552
+ flex: 2;
553
+
554
+ > div.preview-resizer {
555
+ resize: none;
556
+ }
565
557
  }
566
558
  }
567
559
 
@@ -1101,8 +1093,8 @@ input.column-boolean {
1101
1093
  }
1102
1094
 
1103
1095
  @media screen and (max-width: @screen-xs-max) {
1104
- .treeview {
1105
- height: calc(100vh - 370px);
1096
+ .dict-row {
1097
+ grid-column: 1;
1106
1098
  }
1107
1099
  .dict-label {
1108
1100
  text-align: left;
package/src/tab.js CHANGED
@@ -158,7 +158,9 @@
158
158
  this.menu_buttons[item.id] = menuitem;
159
159
  link.click(evt => {
160
160
  evt.preventDefault();
161
- this[item.id]();
161
+ if (!menuitem.hasClass('disabled')) {
162
+ this[item.id]();
163
+ }
162
164
  });
163
165
  } else if (!item && previous) {
164
166
  menuitem = jQuery('<li/>', {
package/src/view/form.js CHANGED
@@ -5015,6 +5015,7 @@ function eval_pyson(value){
5015
5015
  for (const key of new_names) {
5016
5016
  value[key] = null;
5017
5017
  }
5018
+ this.field.set_client(this.record, value);
5018
5019
  this._display().then(() => {
5019
5020
  this.fields[new_names[0]].input.focus();
5020
5021
  });
@@ -5397,7 +5398,9 @@ function eval_pyson(value){
5397
5398
  return value.map(function(e) { return JSON.parse(e); });
5398
5399
  },
5399
5400
  set_value: function(value) {
5400
- value = value.map(function(e) { return JSON.stringify(e); });
5401
+ if (value) {
5402
+ value = value.map(function(e) { return JSON.stringify(e); });
5403
+ }
5401
5404
  this.input.val(value);
5402
5405
  }
5403
5406
  });
package/src/view/tree.js CHANGED
@@ -930,6 +930,7 @@
930
930
  }).map(function(row) {
931
931
  return row.el;
932
932
  }));
933
+ this.update_selection(); // update after new rows has been added
933
934
  if ((this.display_size < this.group.length) &&
934
935
  (!this.tbody.children().last().hasClass('more-row'))) {
935
936
  var more_row = jQuery('<tr/>', {
@@ -994,9 +995,7 @@
994
995
  }
995
996
  },
996
997
  redraw: function(selected, expanded) {
997
- return redraw_async(this.rows, selected, expanded).then(() => {
998
- this.update_selection();
999
- });
998
+ return redraw_async(this.rows, selected, expanded);
1000
999
  },
1001
1000
  switch_: function(path) {
1002
1001
  this.screen.row_activate();
@@ -1221,9 +1220,9 @@
1221
1220
  this.selection.prop('indeterminate', false);
1222
1221
  if (jQuery.isEmptyObject(selected_records)) {
1223
1222
  this.selection.prop('checked', false);
1224
- } else if (selected_records.length ==
1225
- this.tbody.children().length &&
1226
- this.display_size >= this.group.length) {
1223
+ } else if (
1224
+ this.rows.every((row) => row.is_selected()) &&
1225
+ (selected_records.length >= this.tbody.children().length)) {
1227
1226
  this.selection.prop('checked', true);
1228
1227
  } else {
1229
1228
  this.selection.prop('indeterminate', true);
@@ -1323,7 +1322,10 @@
1323
1322
  if (this.editable && new_) {
1324
1323
  td.trigger('click');
1325
1324
  }
1326
- Sao.common.find_focusable_child(td).focus();
1325
+ var child = Sao.common.find_focusable_child(td);
1326
+ if (child) {
1327
+ child.focus();
1328
+ }
1327
1329
  }
1328
1330
  }
1329
1331
  };
package/src/window.js CHANGED
@@ -920,8 +920,14 @@
920
920
  this.title = title;
921
921
  this.exclude_field = kwargs.exclude_field || null;
922
922
  var dialog = new Sao.Dialog(Sao.i18n.gettext(
923
- 'Search %1', this.title), '', 'lg');
923
+ 'Search %1', this.title), '', 'lg', false);
924
924
  this.el = dialog.modal;
925
+ this.el.on('keydown', e => {
926
+ if (e.which == Sao.common.ESC_KEYCODE) {
927
+ e.preventDefault();
928
+ this.response('RESPONSE_CANCEL');
929
+ }
930
+ });
925
931
 
926
932
  jQuery('<button/>', {
927
933
  'class': 'btn btn-link',
@@ -997,7 +1003,8 @@
997
1003
  if (response_id == 'RESPONSE_OK') {
998
1004
  records = this.screen.current_view.selected_records;
999
1005
  } else if (response_id == 'RESPONSE_APPLY') {
1000
- this.screen.search_filter();
1006
+ this.screen.search_filter(
1007
+ this.screen.screen_container.get_text());
1001
1008
  return;
1002
1009
  } else if (response_id == 'RESPONSE_ACCEPT') {
1003
1010
  var view_ids = jQuery.extend([], this.view_ids);
package/src/wizard.js CHANGED
@@ -316,7 +316,8 @@
316
316
  }
317
317
  if (!dialog ||
318
318
  !this.model ||
319
- (Sao.main_menu_screen.model_name == this.model)) {
319
+ (Sao.main_menu_screen &&
320
+ (Sao.main_menu_screen.model_name == this.model))) {
320
321
  is_menu = true;
321
322
  screen = Sao.main_menu_screen;
322
323
  } else {