tryton-sao 5.0.60 → 5.0.61

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 5.0.61 - 2023-02-17
2
+ ---------------------------
3
+ * Bug fixes (see mercurial logs for details)
4
+
1
5
  Version 5.0.60 - 2023-01-15
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.
@@ -3914,12 +3914,7 @@ var Sao = {};
3914
3914
  var values = this._get_on_change_args(
3915
3915
  Object.keys(this._changed).concat(['id']));
3916
3916
  return this.model.execute('pre_validate',
3917
- [values], this.get_context())
3918
- .then(function() {
3919
- return true;
3920
- }, function() {
3921
- return false;
3922
- });
3917
+ [values], this.get_context());
3923
3918
  },
3924
3919
  cancel: function() {
3925
3920
  this._loaded = {};
@@ -11961,13 +11956,8 @@ function eval_pyson(value){
11961
11956
  return;
11962
11957
  }
11963
11958
  if (this.screen.pre_validate) {
11964
- return record.pre_validate().then(function(validate) {
11965
- if (!validate) {
11966
- prm.reject();
11967
- return;
11968
- }
11969
- prm.resolve();
11970
- });
11959
+ return record.pre_validate().then(
11960
+ prm.resolve, prm.reject);
11971
11961
  }
11972
11962
  prm.resolve();
11973
11963
  }.bind(this));
@@ -13093,7 +13083,11 @@ function eval_pyson(value){
13093
13083
  return digits;
13094
13084
  },
13095
13085
  get_value: function() {
13096
- var value = Number(this.input.val());
13086
+ var value = this.input.val();
13087
+ if (!value && (value !== 0)) {
13088
+ return null;
13089
+ }
13090
+ value = Number(value);
13097
13091
  if (isNaN(value)) {
13098
13092
  return null;
13099
13093
  }
@@ -13110,7 +13104,11 @@ function eval_pyson(value){
13110
13104
  Sao.View.Form.Dict.Numeric = Sao.class_(Sao.View.Form.Dict.Float, {
13111
13105
  class_: 'dict-numeric',
13112
13106
  get_value: function() {
13113
- var value = new Sao.Decimal(this.input.val());
13107
+ var value = this.input.val();
13108
+ if (!value && (value !== 0)) {
13109
+ return null;
13110
+ }
13111
+ value = new Sao.Decimal(value);
13114
13112
  if (isNaN(value.valueOf())) {
13115
13113
  return null;
13116
13114
  }
@@ -19931,7 +19929,7 @@ function eval_pyson(value){
19931
19929
  });
19932
19930
 
19933
19931
  Sao.common.get_focus_chain = function(element) {
19934
- var elements = element.find('input', 'textarea');
19932
+ var elements = element.find('input,select,textarea');
19935
19933
  elements.sort(function(a, b) {
19936
19934
  if (('tabindex' in a.attributes) && ('tabindex' in b.attributes)) {
19937
19935
  var a_tabindex = parseInt(a.attributes.tabindex.value);
@@ -20443,7 +20441,10 @@ function eval_pyson(value){
20443
20441
  this.screen.current_record) {
20444
20442
  this.screen.current_record.validate().then(function(validate) {
20445
20443
  if (validate && this.screen.attributes.pre_validate) {
20446
- return this.screen.current_record.pre_validate();
20444
+ return this.screen.current_record.pre_validate().then(
20445
+ function () { return true; },
20446
+ function () { return false; }
20447
+ );
20447
20448
  }
20448
20449
  return validate;
20449
20450
  }.bind(this)).then(function(validate) {