tryton-sao 6.0.27 → 6.0.29

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.0.29 - 2023-05-03
3
+ ---------------------------
4
+ * Bug fixes (see mercurial logs for details)
5
+
6
+ Version 6.0.28 - 2023-02-17
7
+ ---------------------------
8
+ * Bug fixes (see mercurial logs for details)
9
+
1
10
  Version 6.0.27 - 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.
@@ -476,7 +476,9 @@ var Sao = {};
476
476
  }
477
477
  try {
478
478
  attributes.view_ids = loads(params.views || '[]');
479
- attributes.limit = loads(params.limi || 'null');
479
+ if (params.limit !== undefined) {
480
+ attributes.limit = loads(params.limit || 'null');
481
+ }
480
482
  attributes.name = loads(params.name || '""');
481
483
  attributes.search_value = loads(params.search_value || '[]');
482
484
  attributes.domain = loads(params.domain || '[]');
@@ -6661,7 +6663,7 @@ var Sao = {};
6661
6663
  });
6662
6664
 
6663
6665
  Sao.common.get_focus_chain = function(element) {
6664
- var elements = element.find('input', 'textarea');
6666
+ var elements = element.find('input,select,textarea');
6665
6667
  elements.sort(function(a, b) {
6666
6668
  if (('tabindex' in a.attributes) && ('tabindex' in b.attributes)) {
6667
6669
  var a_tabindex = parseInt(a.attributes.tabindex.value);
@@ -8363,12 +8365,7 @@ var Sao = {};
8363
8365
  var values = this._get_on_change_args(
8364
8366
  Object.keys(this._changed).concat(['id']));
8365
8367
  return this.model.execute('pre_validate',
8366
- [values], this.get_context())
8367
- .then(function() {
8368
- return true;
8369
- }, function() {
8370
- return false;
8371
- });
8368
+ [values], this.get_context());
8372
8369
  },
8373
8370
  cancel: function() {
8374
8371
  this._loaded = {};
@@ -8858,6 +8855,12 @@ var Sao = {};
8858
8855
  return value;
8859
8856
  },
8860
8857
  set_client: function(record, value, force_change) {
8858
+ if (value === null) {
8859
+ value = [];
8860
+ }
8861
+ if (typeof(value) == 'string') {
8862
+ value = [value];
8863
+ }
8861
8864
  if (value) {
8862
8865
  value = value.slice().sort();
8863
8866
  }
@@ -15029,7 +15032,8 @@ function eval_pyson(value){
15029
15032
  if (domains.length) {
15030
15033
  domains.map(function(d, i) {
15031
15034
  var name = d[0];
15032
- this.label.text(name + ' ');
15035
+ this.label.append(jQuery('<br/>'));
15036
+ this.label.append(name + ' ');
15033
15037
  jQuery('<span/>', {
15034
15038
  'class': 'badge',
15035
15039
  }).text(counter[i]).appendTo(this.label);
@@ -17374,7 +17378,7 @@ function eval_pyson(value){
17374
17378
  var record = this.record;
17375
17379
  var field_size = record.expr_eval(
17376
17380
  this.attributes.size) || -1;
17377
- field_size -= this.field.get_eval(record);
17381
+ field_size -= this.field.get_eval(record).length;
17378
17382
  var win = new Sao.Window.Form(this.screen, update_sequence, {
17379
17383
  new_: true,
17380
17384
  many: field_size,
@@ -17528,13 +17532,8 @@ function eval_pyson(value){
17528
17532
  return;
17529
17533
  }
17530
17534
  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
- });
17535
+ return record.pre_validate().then(
17536
+ prm.resolve, prm.reject);
17538
17537
  }
17539
17538
  prm.resolve();
17540
17539
  }.bind(this));
@@ -18986,7 +18985,11 @@ function eval_pyson(value){
18986
18985
  }
18987
18986
  },
18988
18987
  get_value: function() {
18989
- var value = Number(this.input.val());
18988
+ var value = this.input.val();
18989
+ if (!value && (value !== 0)) {
18990
+ return null;
18991
+ }
18992
+ value = Number(value);
18990
18993
  if (isNaN(value)) {
18991
18994
  return null;
18992
18995
  }
@@ -19009,7 +19012,11 @@ function eval_pyson(value){
19009
19012
  Sao.View.Form.Dict.Numeric = Sao.class_(Sao.View.Form.Dict.Float, {
19010
19013
  class_: 'dict-numeric',
19011
19014
  get_value: function() {
19012
- var value = new Sao.Decimal(this.input.val());
19015
+ var value = this.input.val();
19016
+ if (!value && (value !== 0)) {
19017
+ return null;
19018
+ }
19019
+ value = new Sao.Decimal(value);
19013
19020
  if (isNaN(value.valueOf())) {
19014
19021
  return null;
19015
19022
  }
@@ -22784,6 +22791,11 @@ function eval_pyson(value){
22784
22791
  },
22785
22792
  set record(value) {
22786
22793
  this._record = value;
22794
+ },
22795
+ button_clicked: function(event) {
22796
+ if (Sao.common.compare(this.screen.selected_records, [this.record])) {
22797
+ Sao.View.ListGroupViewForm._super.button_clicked.call(this, event);
22798
+ }
22787
22799
  }
22788
22800
  });
22789
22801
 
@@ -23593,7 +23605,10 @@ function eval_pyson(value){
23593
23605
  this.screen.current_record) {
23594
23606
  this.screen.current_record.validate().then(function(validate) {
23595
23607
  if (validate && this.screen.attributes.pre_validate) {
23596
- return this.screen.current_record.pre_validate();
23608
+ return this.screen.current_record.pre_validate().then(
23609
+ function () { return true; },
23610
+ function () { return false; }
23611
+ );
23597
23612
  }
23598
23613
  return validate;
23599
23614
  }.bind(this)).then(function(validate) {
@@ -25154,7 +25169,8 @@ function eval_pyson(value){
25154
25169
  } else {
25155
25170
  domain = this.screen.search_domain(
25156
25171
  this.screen.screen_container.get_text());
25157
- if (!this.ignore_search_limit.prop('checked')) {
25172
+ if (!this.ignore_search_limit.prop('checked') &&
25173
+ this.screen.limit !== null) {
25158
25174
  query_string.push(['s', this.screen.limit.toString()]);
25159
25175
  query_string.push(
25160
25176
  ['p', Math.floor(