tryton-sao 6.4.11 → 6.4.13

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,3 +1,12 @@
1
+
2
+ Version 6.4.13 - 2023-04-01
3
+ ---------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+ Version 6.4.12 - 2023-02-17
7
+ ---------------------------
8
+ * Bug fixes (see mercurial logs for details)
9
+
1
10
  Version 6.4.11 - 2023-02-05
2
11
  ---------------------------
3
12
  * Bug fixes (see mercurial logs for details)
package/COPYRIGHT CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (C) 2012-2022 Nicolas Évrard.
1
+ Copyright (C) 2012-2023 Nicolas Évrard.
2
2
  Copyright (C) 2012-2023 Cédric Krier.
3
3
  Copyright (C) 2012-2014 Bertrand Chenal.
4
4
  Copyright (C) 2012-2023 B2CK SPRL.
@@ -6763,7 +6763,7 @@ var Sao = {};
6763
6763
  });
6764
6764
 
6765
6765
  Sao.common.get_focus_chain = function(element) {
6766
- var elements = element.find('input', 'textarea');
6766
+ var elements = element.find('input,select,textarea');
6767
6767
  elements.sort(function(a, b) {
6768
6768
  if (('tabindex' in a.attributes) && ('tabindex' in b.attributes)) {
6769
6769
  var a_tabindex = parseInt(a.attributes.tabindex.value);
@@ -8442,8 +8442,7 @@ var Sao = {};
8442
8442
  var values = this._get_on_change_args(
8443
8443
  Object.keys(this.modified_fields).concat(['id']));
8444
8444
  return this.model.execute('pre_validate',
8445
- [values], this.get_context())
8446
- .then(() => true, () => false);
8445
+ [values], this.get_context());
8447
8446
  },
8448
8447
  cancel: function() {
8449
8448
  this._loaded = {};
@@ -8703,13 +8702,13 @@ var Sao = {};
8703
8702
  var previous_value = this.get(record);
8704
8703
  this.set(record, value);
8705
8704
  if (this._has_changed(previous_value, this.get(record))) {
8706
- record.set_modified(this.name);
8707
8705
  this.changed(record);
8708
8706
  record.validate(null, true, false, true);
8707
+ record.set_modified(this.name);
8709
8708
  } else if (force_change) {
8710
- this.set_modified();
8711
8709
  this.changed(record);
8712
8710
  record.validate(null, true, false, true);
8711
+ record.set_modified();
8713
8712
  }
8714
8713
  },
8715
8714
  get_client: function(record) {
@@ -9431,13 +9430,13 @@ var Sao = {};
9431
9430
  previous_ids.sort(), value.sort());
9432
9431
  this._set_value(record, value, false, modified);
9433
9432
  if (modified) {
9434
- record.set_modified(this.name);
9435
9433
  this.changed(record);
9436
9434
  record.validate(null, true, false, true);
9435
+ record.set_modified(this.name);
9437
9436
  } else if (force_change) {
9438
- record.set_modified();
9439
9437
  this.changed(record);
9440
9438
  record.validate(null, true, false, true);
9439
+ record.set_modified();
9441
9440
  }
9442
9441
  },
9443
9442
  get_client: function(record) {
@@ -13301,7 +13300,9 @@ var Sao = {};
13301
13300
  }
13302
13301
  const display = () => {
13303
13302
  // Return the original promise to keep succeed/rejected state
13304
- return this.display().then(() => prm, () => prm);
13303
+ return this.display()
13304
+ .always(() => this.record_saved())
13305
+ .then(() => prm, () => prm);
13305
13306
  };
13306
13307
  return prm.then(current_record => {
13307
13308
  if (path && current_record && current_record.id) {
@@ -15174,7 +15175,7 @@ function eval_pyson(value){
15174
15175
  'method': (
15175
15176
  'model.' + action.res_model + '.search_count'),
15176
15177
  'params': [
15177
- ['AND', domain, 0, tab_domain], 100, context],
15178
+ ['AND', domain, tab_domain], 0, 100, context],
15178
15179
  }, Sao.Session.current_session).then(value => {
15179
15180
  this._set_count(
15180
15181
  value, i, current, counter,
@@ -15210,7 +15211,8 @@ function eval_pyson(value){
15210
15211
  if (domains.length) {
15211
15212
  domains.map(function(d, i) {
15212
15213
  var name = d[0];
15213
- this.label.text(name + ' ');
15214
+ this.label.append(jQuery('<br/>'));
15215
+ this.label.append(name + ' ');
15214
15216
  jQuery('<span/>', {
15215
15217
  'class': 'badge',
15216
15218
  }).text(counter[i]).appendTo(this.label);
@@ -17784,13 +17786,8 @@ function eval_pyson(value){
17784
17786
  return;
17785
17787
  }
17786
17788
  if (this.screen.pre_validate) {
17787
- return record.pre_validate().then(function(validate) {
17788
- if (!validate) {
17789
- prm.reject();
17790
- return;
17791
- }
17792
- prm.resolve();
17793
- });
17789
+ return record.pre_validate().then(
17790
+ prm.resolve, prm.reject);
17794
17791
  }
17795
17792
  prm.resolve();
17796
17793
  });
@@ -19283,7 +19280,11 @@ function eval_pyson(value){
19283
19280
  }
19284
19281
  },
19285
19282
  get_value: function() {
19286
- var value = Number(this.input.val());
19283
+ var value = this.input.val();
19284
+ if (!value && (value !== 0)) {
19285
+ return null;
19286
+ }
19287
+ value = Number(value);
19287
19288
  if (isNaN(value)) {
19288
19289
  return null;
19289
19290
  }
@@ -19306,7 +19307,11 @@ function eval_pyson(value){
19306
19307
  Sao.View.Form.Dict.Numeric = Sao.class_(Sao.View.Form.Dict.Float, {
19307
19308
  class_: 'dict-numeric',
19308
19309
  get_value: function() {
19309
- var value = new Sao.Decimal(this.input.val());
19310
+ var value = this.input.val();
19311
+ if (!value && (value !== 0)) {
19312
+ return null;
19313
+ }
19314
+ value = new Sao.Decimal(value);
19310
19315
  if (isNaN(value.valueOf())) {
19311
19316
  return null;
19312
19317
  }
@@ -23327,6 +23332,11 @@ function eval_pyson(value){
23327
23332
  },
23328
23333
  set record(value) {
23329
23334
  this._record = value;
23335
+ },
23336
+ button_clicked: function(event) {
23337
+ if (Sao.common.compare(this.screen.selected_records, [this.record])) {
23338
+ Sao.View.ListGroupViewForm._super.button_clicked.call(this, event);
23339
+ }
23330
23340
  }
23331
23341
  });
23332
23342
 
@@ -24183,7 +24193,10 @@ function eval_pyson(value){
24183
24193
  this.screen.current_record) {
24184
24194
  this.screen.current_record.validate().then(validate => {
24185
24195
  if (validate && this.screen.attributes.pre_validate) {
24186
- return this.screen.current_record.pre_validate();
24196
+ return this.screen.current_record.pre_validate().then(
24197
+ function () { return true; },
24198
+ function () { return false; }
24199
+ );
24187
24200
  }
24188
24201
  return validate;
24189
24202
  }).then(validate => {