tryton-sao 6.0.27 → 6.0.28

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,7 @@
1
+ Version 6.0.28 - 2023-02-17
2
+ ---------------------------
3
+ * Bug fixes (see mercurial logs for details)
4
+
1
5
  Version 6.0.27 - 2023-02-05
2
6
  ---------------------------
3
7
  * 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.
@@ -6661,7 +6661,7 @@ var Sao = {};
6661
6661
  });
6662
6662
 
6663
6663
  Sao.common.get_focus_chain = function(element) {
6664
- var elements = element.find('input', 'textarea');
6664
+ var elements = element.find('input,select,textarea');
6665
6665
  elements.sort(function(a, b) {
6666
6666
  if (('tabindex' in a.attributes) && ('tabindex' in b.attributes)) {
6667
6667
  var a_tabindex = parseInt(a.attributes.tabindex.value);
@@ -8363,12 +8363,7 @@ var Sao = {};
8363
8363
  var values = this._get_on_change_args(
8364
8364
  Object.keys(this._changed).concat(['id']));
8365
8365
  return this.model.execute('pre_validate',
8366
- [values], this.get_context())
8367
- .then(function() {
8368
- return true;
8369
- }, function() {
8370
- return false;
8371
- });
8366
+ [values], this.get_context());
8372
8367
  },
8373
8368
  cancel: function() {
8374
8369
  this._loaded = {};
@@ -15029,7 +15024,8 @@ function eval_pyson(value){
15029
15024
  if (domains.length) {
15030
15025
  domains.map(function(d, i) {
15031
15026
  var name = d[0];
15032
- this.label.text(name + ' ');
15027
+ this.label.append(jQuery('<br/>'));
15028
+ this.label.append(name + ' ');
15033
15029
  jQuery('<span/>', {
15034
15030
  'class': 'badge',
15035
15031
  }).text(counter[i]).appendTo(this.label);
@@ -17528,13 +17524,8 @@ function eval_pyson(value){
17528
17524
  return;
17529
17525
  }
17530
17526
  if (this.screen.pre_validate) {
17531
- return record.pre_validate().then(function(validate) {
17532
- if (!validate) {
17533
- prm.reject();
17534
- return;
17535
- }
17536
- prm.resolve();
17537
- });
17527
+ return record.pre_validate().then(
17528
+ prm.resolve, prm.reject);
17538
17529
  }
17539
17530
  prm.resolve();
17540
17531
  }.bind(this));
@@ -18986,7 +18977,11 @@ function eval_pyson(value){
18986
18977
  }
18987
18978
  },
18988
18979
  get_value: function() {
18989
- var value = Number(this.input.val());
18980
+ var value = this.input.val();
18981
+ if (!value && (value !== 0)) {
18982
+ return null;
18983
+ }
18984
+ value = Number(value);
18990
18985
  if (isNaN(value)) {
18991
18986
  return null;
18992
18987
  }
@@ -19009,7 +19004,11 @@ function eval_pyson(value){
19009
19004
  Sao.View.Form.Dict.Numeric = Sao.class_(Sao.View.Form.Dict.Float, {
19010
19005
  class_: 'dict-numeric',
19011
19006
  get_value: function() {
19012
- var value = new Sao.Decimal(this.input.val());
19007
+ var value = this.input.val();
19008
+ if (!value && (value !== 0)) {
19009
+ return null;
19010
+ }
19011
+ value = new Sao.Decimal(value);
19013
19012
  if (isNaN(value.valueOf())) {
19014
19013
  return null;
19015
19014
  }
@@ -22784,6 +22783,11 @@ function eval_pyson(value){
22784
22783
  },
22785
22784
  set record(value) {
22786
22785
  this._record = value;
22786
+ },
22787
+ button_clicked: function(event) {
22788
+ if (Sao.common.compare(this.screen.selected_records, [this.record])) {
22789
+ Sao.View.ListGroupViewForm._super.button_clicked.call(this, event);
22790
+ }
22787
22791
  }
22788
22792
  });
22789
22793
 
@@ -23593,7 +23597,10 @@ function eval_pyson(value){
23593
23597
  this.screen.current_record) {
23594
23598
  this.screen.current_record.validate().then(function(validate) {
23595
23599
  if (validate && this.screen.attributes.pre_validate) {
23596
- return this.screen.current_record.pre_validate();
23600
+ return this.screen.current_record.pre_validate().then(
23601
+ function () { return true; },
23602
+ function () { return false; }
23603
+ );
23597
23604
  }
23598
23605
  return validate;
23599
23606
  }.bind(this)).then(function(validate) {