tryton-sao 7.0.31 → 7.0.33

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.33 - 2025-07-15
3
+ ---------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+
7
+ Version 7.0.32 - 2025-07-01
8
+ ---------------------------
9
+ * Bug fixes (see mercurial logs for details)
10
+
11
+
2
12
  Version 7.0.31 - 2025-06-04
3
13
  ---------------------------
4
14
  * Bug fixes (see mercurial logs for details)
@@ -8777,6 +8777,11 @@ html[theme="default"] .radio input[type="radio"]:focus,
8777
8777
  html[theme="default"] .radio-inline input[type="radio"]:focus {
8778
8778
  outline: none;
8779
8779
  }
8780
+ html[theme="default"] input[type="radio"]:focus:after,
8781
+ html[theme="default"] .radio input[type="radio"]:focus:after,
8782
+ html[theme="default"] .radio-inline input[type="radio"]:focus:after {
8783
+ border-color: #71bdc1 !important;
8784
+ }
8780
8785
  html[theme="default"] input[type="radio"]:before,
8781
8786
  html[theme="default"] .radio input[type="radio"]:before,
8782
8787
  html[theme="default"] .radio-inline input[type="radio"]:before,
@@ -8866,10 +8871,10 @@ html[theme="default"] .checkbox input[type="checkbox"]:focus,
8866
8871
  html[theme="default"] .checkbox-inline input[type="checkbox"]:focus {
8867
8872
  outline: none;
8868
8873
  }
8869
- html[theme="default"] input[type="checkbox"]:focus:before,
8870
- html[theme="default"] .checkbox input[type="checkbox"]:focus:before,
8871
- html[theme="default"] .checkbox-inline input[type="checkbox"]:focus:before {
8872
- border-color: #267f82;
8874
+ html[theme="default"] input[type="checkbox"]:focus:after,
8875
+ html[theme="default"] .checkbox input[type="checkbox"]:focus:after,
8876
+ html[theme="default"] .checkbox-inline input[type="checkbox"]:focus:after {
8877
+ border-color: #71bdc1 !important;
8873
8878
  }
8874
8879
  html[theme="default"] input[type="checkbox"]:before,
8875
8880
  html[theme="default"] .checkbox input[type="checkbox"]:before,
@@ -9201,7 +9206,8 @@ html[theme="default"] .carousel-caption h6 {
9201
9206
  float: none;
9202
9207
  }
9203
9208
  }
9204
- .btn-primary .icon {
9209
+ .btn-primary .icon,
9210
+ .bg-primary .icon {
9205
9211
  filter: brightness(0) invert(1);
9206
9212
  }
9207
9213
  .panel-heading a {
@@ -3,7 +3,7 @@
3
3
 
4
4
  /* eslint-disable no-redeclare */
5
5
  var Sao = {
6
- __version__: '7.0.31',
6
+ __version__: '7.0.33',
7
7
  };
8
8
  /* eslint-enable no-redeclare */
9
9
 
@@ -1136,20 +1136,26 @@ var Sao = {
1136
1136
  shortcut: 'alt+shift+tab',
1137
1137
  label: Sao.i18n.gettext('Previous tab'),
1138
1138
  callback: function() {
1139
- Sao.Tab.previous_tab();
1139
+ if (!jQuery('body').children('.modal').length) {
1140
+ Sao.Tab.previous_tab();
1141
+ }
1140
1142
  },
1141
1143
  }, {
1142
1144
  shortcut: 'alt+tab',
1143
1145
  label: Sao.i18n.gettext('Next tab'),
1144
1146
  callback: function() {
1145
- Sao.Tab.next_tab();
1147
+ if (!jQuery('body').children('.modal').length) {
1148
+ Sao.Tab.next_tab();
1149
+ }
1146
1150
  },
1147
1151
  }, {
1148
1152
  shortcut: 'ctrl+k',
1149
1153
  label: Sao.i18n.gettext('Global search'),
1150
1154
  callback: function() {
1151
- jQuery('#main_navbar:hidden').collapse('show');
1152
- jQuery('#global-search-entry').focus();
1155
+ if (!jQuery('body').children('.modal').length) {
1156
+ jQuery('#main_navbar:hidden').collapse('show');
1157
+ jQuery('#global-search-entry').focus();
1158
+ }
1153
1159
  },
1154
1160
  }, {
1155
1161
  shortcut: 'f1',
@@ -5206,8 +5212,13 @@ var Sao = {
5206
5212
  }
5207
5213
  let { format } = new Intl.NumberFormat(
5208
5214
  Sao.i18n.BC47(Sao.i18n.getlang()));
5215
+ // use 10000 because some language (ex: es) add thousand
5216
+ // separator only after 9999
5217
+ let [, thousandSeparator] = /^10(.)?000/.exec(format(10000));
5209
5218
  let [, decimalSign] = /^0(.)1$/.exec(format(0.1));
5210
- return Number(string.replace(decimalSign, '.'));
5219
+ return Number(string
5220
+ .replace(new RegExp(thousandSeparator, 'g'), '')
5221
+ .replace(decimalSign, '.'));
5211
5222
  }
5212
5223
  var convert_selection = function() {
5213
5224
  if (typeof value == 'string') {
@@ -11347,40 +11358,40 @@ var Sao = {
11347
11358
  });
11348
11359
  },
11349
11360
  modified_save: function() {
11350
- this.screen.save_tree_state();
11351
- this.screen.current_view.set_value();
11352
- if (this.screen.modified()) {
11353
- return Sao.common.sur_3b.run(
11354
- Sao.i18n.gettext('This record has been modified\n' +
11355
- 'do you want to save it?'))
11356
- .then(result => {
11357
- switch(result) {
11358
- case 'ok':
11359
- return this.save();
11360
- case 'ko':
11361
- var record_id = null;
11362
- if (this.screen.current_record) {
11363
- record_id = this.screen.current_record.id;
11364
- }
11365
- return this.reload(false).then(() => {
11366
- if (record_id !== null) {
11367
- if (record_id < 0) {
11368
- return jQuery.Deferred().reject(true);
11369
- }
11370
- else if (this.screen.current_record) {
11371
- if (record_id !=
11372
- this.screen.current_record.id) {
11373
- return jQuery.Deferred().reject();
11361
+ return this.screen.save_tree_state().then(() => {
11362
+ this.screen.current_view.set_value();
11363
+ if (this.screen.modified()) {
11364
+ return Sao.common.sur_3b.run(
11365
+ Sao.i18n.gettext('This record has been modified\n' +
11366
+ 'do you want to save it?'))
11367
+ .then(result => {
11368
+ switch(result) {
11369
+ case 'ok':
11370
+ return this.save();
11371
+ case 'ko':
11372
+ var record_id = null;
11373
+ if (this.screen.current_record) {
11374
+ record_id = this.screen.current_record.id;
11375
+ }
11376
+ return this.reload(false).then(() => {
11377
+ if (record_id !== null) {
11378
+ if (record_id < 0) {
11379
+ return jQuery.Deferred().reject(true);
11380
+ }
11381
+ else if (this.screen.current_record) {
11382
+ if (record_id !=
11383
+ this.screen.current_record.id) {
11384
+ return jQuery.Deferred().reject();
11385
+ }
11374
11386
  }
11375
11387
  }
11376
- }
11377
- });
11378
- default:
11379
- return jQuery.Deferred().reject();
11380
- }
11381
- });
11382
- }
11383
- return jQuery.when();
11388
+ });
11389
+ default:
11390
+ return jQuery.Deferred().reject();
11391
+ }
11392
+ });
11393
+ }
11394
+ });
11384
11395
  },
11385
11396
  new_: function() {
11386
11397
  if (!Sao.common.MODELACCESS.get(this.screen.model_name).create) {
@@ -11394,24 +11405,29 @@ var Sao = {
11394
11405
  });
11395
11406
  },
11396
11407
  save: function(tab) {
11408
+ let prm;
11397
11409
  if (tab) {
11398
11410
  // Called from button so we must save the tree state
11399
- this.screen.save_tree_state();
11400
- }
11401
- var access = Sao.common.MODELACCESS.get(this.screen.model_name);
11402
- if (this.screen.readonly || !(access.write || access.create)) {
11403
- return jQuery.Deferred().reject();
11411
+ prm = this.screen.save_tree_state();
11412
+ } else {
11413
+ prm = jQuery.when();
11404
11414
  }
11405
- return this.screen.save_current().then(
11406
- () => {
11407
- this.info_bar.add(
11408
- Sao.i18n.gettext('Record saved.'), 'info');
11409
- this.screen.count_tab_domain(true);
11410
- }, () => {
11411
- this.info_bar.add(
11412
- this.screen.invalid_message(), 'danger');
11415
+ prm.then(() => {
11416
+ var access = Sao.common.MODELACCESS.get(this.screen.model_name);
11417
+ if (this.screen.readonly || !(access.write || access.create)) {
11413
11418
  return jQuery.Deferred().reject();
11414
- });
11419
+ }
11420
+ return this.screen.save_current().then(
11421
+ () => {
11422
+ this.info_bar.add(
11423
+ Sao.i18n.gettext('Record saved.'), 'info');
11424
+ this.screen.count_tab_domain(true);
11425
+ }, () => {
11426
+ this.info_bar.add(
11427
+ this.screen.invalid_message(), 'danger');
11428
+ return jQuery.Deferred().reject();
11429
+ });
11430
+ });
11415
11431
  },
11416
11432
  switch_: function() {
11417
11433
  return this.modified_save().then(() => this.screen.switch_view());
@@ -11450,8 +11466,7 @@ var Sao = {
11450
11466
  if (test_modified) {
11451
11467
  return this.modified_save().then(reload);
11452
11468
  } else {
11453
- this.screen.save_tree_state(false);
11454
- return reload();
11469
+ return this.screen.save_tree_state(false).then(reload);
11455
11470
  }
11456
11471
  },
11457
11472
  copy: function() {
@@ -18485,7 +18500,6 @@ function eval_pyson(value){
18485
18500
  return prm;
18486
18501
  },
18487
18502
  set_value: function() {
18488
- this.screen.save_tree_state();
18489
18503
  if (this.screen.modified()) { // TODO check if required
18490
18504
  this.view.screen.record_modified(false);
18491
18505
  }
@@ -22122,12 +22136,13 @@ function eval_pyson(value){
22122
22136
  current_record = this.tree.screen.current_record;
22123
22137
  this.tree.select_records(current_record, this.record);
22124
22138
  } else {
22139
+ let selected = this.is_selected();
22125
22140
  if (!(event_.ctrlKey || event_.metaKey) ||
22126
22141
  this.tree.selection_mode ==
22127
22142
  Sao.common.SELECTION_SINGLE) {
22128
22143
  this.tree.select_records(null, null);
22129
22144
  }
22130
- this.set_selection(!this.is_selected());
22145
+ this.set_selection(!selected);
22131
22146
  }
22132
22147
  this.selection_changed();
22133
22148
  if (current_record) {
@@ -22158,6 +22173,9 @@ function eval_pyson(value){
22158
22173
  },
22159
22174
  selection_changed: function() {
22160
22175
  var is_selected = this.is_selected();
22176
+ if (this.tree.selection_mode == Sao.common.SELECTION_SINGLE) {
22177
+ this.tree.select_records(null, null);
22178
+ }
22161
22179
  this.set_selection(is_selected);
22162
22180
  if (is_selected) {
22163
22181
  this.tree.select_changed(this.record);
@@ -22315,10 +22333,13 @@ function eval_pyson(value){
22315
22333
  }
22316
22334
  listener.on('click.sao.editabletree', handler);
22317
22335
 
22318
- Sao.View.Tree.RowEditable._super.select_row.call(this, event_);
22319
-
22320
- if (!event_.shiftKey && !(event_.ctrlKey || event_.metaKey)) {
22336
+ // do not call super when editing row because the selection must
22337
+ // not be changed
22338
+ if (!event_.shiftKey && !(event_.ctrlKey || event_.metaKey) &&
22339
+ (this.record === current_record)) {
22321
22340
  this.tree.edit_row(this);
22341
+ } else {
22342
+ Sao.View.Tree.RowEditable._super.select_row.call(this, event_);
22322
22343
  }
22323
22344
  },
22324
22345
  unset_editable: function() {
@@ -23291,6 +23312,7 @@ function eval_pyson(value){
23291
23312
  if (states.invisible || states.readonly) {
23292
23313
  return;
23293
23314
  }
23315
+ event.stopImmediatePropagation();
23294
23316
  button.el.prop('disabled', true); // state will be reset at display
23295
23317
  var row = this.view.rows.find(function(row) {
23296
23318
  return row.record == record;
@@ -8777,6 +8777,11 @@ html[theme="default"] .radio input[type="radio"]:focus,
8777
8777
  html[theme="default"] .radio-inline input[type="radio"]:focus {
8778
8778
  outline: none;
8779
8779
  }
8780
+ html[theme="default"] input[type="radio"]:focus:after,
8781
+ html[theme="default"] .radio input[type="radio"]:focus:after,
8782
+ html[theme="default"] .radio-inline input[type="radio"]:focus:after {
8783
+ border-color: #71bdc1 !important;
8784
+ }
8780
8785
  html[theme="default"] input[type="radio"]:before,
8781
8786
  html[theme="default"] .radio input[type="radio"]:before,
8782
8787
  html[theme="default"] .radio-inline input[type="radio"]:before,
@@ -8866,10 +8871,10 @@ html[theme="default"] .checkbox input[type="checkbox"]:focus,
8866
8871
  html[theme="default"] .checkbox-inline input[type="checkbox"]:focus {
8867
8872
  outline: none;
8868
8873
  }
8869
- html[theme="default"] input[type="checkbox"]:focus:before,
8870
- html[theme="default"] .checkbox input[type="checkbox"]:focus:before,
8871
- html[theme="default"] .checkbox-inline input[type="checkbox"]:focus:before {
8872
- border-color: #267f82;
8874
+ html[theme="default"] input[type="checkbox"]:focus:after,
8875
+ html[theme="default"] .checkbox input[type="checkbox"]:focus:after,
8876
+ html[theme="default"] .checkbox-inline input[type="checkbox"]:focus:after {
8877
+ border-color: #71bdc1 !important;
8873
8878
  }
8874
8879
  html[theme="default"] input[type="checkbox"]:before,
8875
8880
  html[theme="default"] .checkbox input[type="checkbox"]:before,
@@ -9201,7 +9206,8 @@ html[theme="default"] .carousel-caption h6 {
9201
9206
  float: none;
9202
9207
  }
9203
9208
  }
9204
- .btn-primary .icon {
9209
+ .btn-primary .icon,
9210
+ .bg-primary .icon {
9205
9211
  filter: brightness(0) invert(1);
9206
9212
  }
9207
9213
  .panel-heading a {