tryton-sao 6.2.1 → 6.2.2

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,6 @@
1
+ Version 6.2.2 - 2022-01-01
2
+ * Bug fixes (see mercurial logs for details)
3
+
1
4
  Version 6.2.1 - 2021-12-03
2
5
  * Bug fixes (see mercurial logs for details)
3
6
 
@@ -8534,7 +8534,11 @@ var Sao = {};
8534
8534
  Object.keys(this._values).reduce(function(values, name) {
8535
8535
  var field = this.model.fields[name];
8536
8536
  if (field) {
8537
- values[name] = field.get(this);
8537
+ if (field instanceof Sao.field.Binary) {
8538
+ values[name] = field.get_size(this);
8539
+ } else {
8540
+ values[name] = field.get(this);
8541
+ }
8538
8542
  }
8539
8543
  return values;
8540
8544
  }.bind(this), {}));
@@ -8667,12 +8671,14 @@ var Sao = {};
8667
8671
  }
8668
8672
  return value;
8669
8673
  },
8674
+ _has_changed: function(previous, value) {
8675
+ // Use stringify to compare object instance like Number for Decimal
8676
+ return JSON.stringify(previous) != JSON.stringify(value);
8677
+ },
8670
8678
  set_client: function(record, value, force_change) {
8671
8679
  var previous_value = this.get(record);
8672
8680
  this.set(record, value);
8673
- // Use stringify to compare object instance like Number for Decimal
8674
- if (JSON.stringify(previous_value) !=
8675
- JSON.stringify(this.get(record))) {
8681
+ if (this._has_changed(previous_value, this.get(record))) {
8676
8682
  record._changed[this.name] = true;
8677
8683
  this.changed(record);
8678
8684
  record.validate(null, true, false, true);
@@ -9831,6 +9837,9 @@ var Sao = {};
9831
9837
 
9832
9838
  Sao.field.Binary = Sao.class_(Sao.field.Field, {
9833
9839
  _default: null,
9840
+ _has_changed: function(previous, value) {
9841
+ return previous != value;
9842
+ },
9834
9843
  get_size: function(record) {
9835
9844
  var data = record._values[this.name] || 0;
9836
9845
  if (data instanceof Uint8Array) {
@@ -11462,7 +11471,9 @@ var Sao = {};
11462
11471
  'disabled', this.screen.readonly);
11463
11472
 
11464
11473
  var msg = name + ' / ' + data[1];
11465
- if ((data[1] < data[2]) && (data[2] > this.screen.limit)) {
11474
+ if ((data[1] < data[2]) &&
11475
+ this.screen.limit !== null &&
11476
+ (data[2] > this.screen.limit)) {
11466
11477
  msg += Sao.i18n.gettext(' of ') + data[2];
11467
11478
  }
11468
11479
  this.status_label.text(msg).attr('title', msg);
@@ -12298,7 +12309,7 @@ var Sao = {};
12298
12309
  init: function(format, id) {
12299
12310
  this.format = format;
12300
12311
  Sao.ScreenContainer.BetweenDates._super.init.call(this, id);
12301
- this.from.on('dp.change', this._from_changed.bind(this));
12312
+ this.from.change(this._from_changed.bind(this));
12302
12313
  },
12303
12314
  _get_value: function(entry, value) {
12304
12315
  return entry.find('input[type=text]').val();
@@ -14997,14 +15008,12 @@ function eval_pyson(value){
14997
15008
  'aria-controls': this.collapsible.attr('id'),
14998
15009
  'aria-expanded': attributes.expandable == '1',
14999
15010
  }).appendTo(title);
15000
- link.append(jQuery('<div/>', {
15001
- 'class': 'btn btn-sm',
15002
- }).append(jQuery('<span/>', {
15003
- 'class': 'caret',
15004
- })));
15005
15011
  if (attributes.string) {
15006
15012
  link.text(attributes.string);
15007
15013
  }
15014
+ link.append(jQuery('<span/>', {
15015
+ 'class': 'caret',
15016
+ }));
15008
15017
  },
15009
15018
  add: function(widget) {
15010
15019
  this.body.empty();