tryton-sao 6.4.7 → 6.4.9

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,11 @@
1
+ Version 6.4.9 - 2023-01-02
2
+ --------------------------
3
+ * Bug fixes (see mercurial logs for details)
4
+
5
+ Version 6.4.8 - 2022-12-06
6
+ --------------------------
7
+ * Bug fixes (see mercurial logs for details)
8
+
1
9
  Version 6.4.7 - 2022-11-05
2
10
  --------------------------
3
11
  * Bug fixes (see mercurial logs for details)
@@ -3769,9 +3769,12 @@ var Sao = {};
3769
3769
  };
3770
3770
 
3771
3771
  var evaluator;
3772
- if (field.description.type == 'reference') {
3772
+ var type_ = field.description.type;
3773
+ if (type_ == 'reference') {
3773
3774
  var allowed_models = field.get_models(record);
3774
3775
  evaluator = _model_evaluator(allowed_models);
3776
+ } else if (type_ == 'multiselection') {
3777
+ return;
3775
3778
  } else {
3776
3779
  evaluator = _value_evaluator;
3777
3780
  }
@@ -5621,7 +5624,7 @@ var Sao = {};
5621
5624
  }
5622
5625
  if ((name.split('.').length - 1) == count &&
5623
5626
  (domain[1] == '=')) {
5624
- return [true, domain[1], value];
5627
+ return [true, name, value];
5625
5628
  }
5626
5629
  }
5627
5630
  return [false, null, null];
@@ -9321,7 +9324,15 @@ var Sao = {};
9321
9324
  group.load(value, modified || default_);
9322
9325
  } else {
9323
9326
  for (const vals of value) {
9324
- var new_record = group.new_(false);
9327
+ var new_record;
9328
+ if ('id' in vals) {
9329
+ new_record = group.get(vals.id);
9330
+ if (!new_record) {
9331
+ new_record = group.new_(false, vals.id);
9332
+ }
9333
+ } else {
9334
+ new_record = group.new_(false);
9335
+ }
9325
9336
  if (default_) {
9326
9337
  // Don't validate as parent will validate
9327
9338
  new_record.set_default(vals, false, false);
@@ -12491,8 +12502,7 @@ var Sao = {};
12491
12502
  this.domain = attributes.domain || [];
12492
12503
  this.context_domain = attributes.context_domain;
12493
12504
  this.size_limit = null;
12494
- if ((this.attributes.limit === undefined) ||
12495
- (this.attributes.limit === null)) {
12505
+ if (this.attributes.limit === undefined) {
12496
12506
  this.limit = Sao.config.limit;
12497
12507
  } else {
12498
12508
  this.limit = attributes.limit;
@@ -16376,15 +16386,26 @@ function eval_pyson(value){
16376
16386
  },
16377
16387
  get modified() {
16378
16388
  if (this.record && this.field) {
16379
- return this.field.get_client(this.record) != this.get_value();
16389
+ var value = this._normalize_newline(
16390
+ this.field.get_client(this.record));
16391
+ return value != this.get_value();
16380
16392
  }
16381
16393
  return false;
16382
16394
  },
16383
16395
  get_value: function() {
16384
- return this.input.val() || '';
16396
+ return this._normalize_newline(this.input.val() || '');
16385
16397
  },
16386
16398
  set_value: function() {
16387
- this.field.set_client(this.record, this.get_value());
16399
+ // avoid modification of not normalized value
16400
+ var value = this.get_value();
16401
+ var prev_value = this.field.get_client(this.record);
16402
+ if (value == this._normalize_newline(prev_value)) {
16403
+ value = prev_value;
16404
+ }
16405
+ this.field.set_client(this.record, value);
16406
+ },
16407
+ _normalize_newline: function(content) {
16408
+ return content.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
16388
16409
  },
16389
16410
  set_readonly: function(readonly) {
16390
16411
  Sao.View.Form.Text._super.set_readonly.call(this, readonly);
@@ -19658,7 +19679,8 @@ function eval_pyson(value){
19658
19679
  sum_row.append(jQuery('<th/>'));
19659
19680
  this.tfoot = jQuery('<tfoot/>');
19660
19681
  this.tfoot.append(sum_row);
19661
- this.table.append(this.tfoot);
19682
+ // insert before thead to not hide drop-down from thead
19683
+ this.table.prepend(this.tfoot);
19662
19684
  }
19663
19685
 
19664
19686
  if (this.children_field) {