tryton-sao 6.4.7 → 6.4.8

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.4.8 - 2022-12-06
2
+ --------------------------
3
+ * Bug fixes (see mercurial logs for details)
4
+
1
5
  Version 6.4.7 - 2022-11-05
2
6
  --------------------------
3
7
  * 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
  }
@@ -16376,15 +16379,26 @@ function eval_pyson(value){
16376
16379
  },
16377
16380
  get modified() {
16378
16381
  if (this.record && this.field) {
16379
- return this.field.get_client(this.record) != this.get_value();
16382
+ var value = this._normalize_newline(
16383
+ this.field.get_client(this.record));
16384
+ return value != this.get_value();
16380
16385
  }
16381
16386
  return false;
16382
16387
  },
16383
16388
  get_value: function() {
16384
- return this.input.val() || '';
16389
+ return this._normalize_newline(this.input.val() || '');
16385
16390
  },
16386
16391
  set_value: function() {
16387
- this.field.set_client(this.record, this.get_value());
16392
+ // avoid modification of not normalized value
16393
+ var value = this.get_value();
16394
+ var prev_value = this.field.get_client(this.record);
16395
+ if (value == this._normalize_newline(prev_value)) {
16396
+ value = prev_value;
16397
+ }
16398
+ this.field.set_client(this.record, value);
16399
+ },
16400
+ _normalize_newline: function(content) {
16401
+ return content.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
16388
16402
  },
16389
16403
  set_readonly: function(readonly) {
16390
16404
  Sao.View.Form.Text._super.set_readonly.call(this, readonly);