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 +3 -0
- package/dist/tryton-sao.js +20 -11
- package/dist/tryton-sao.min.js +2 -2
- package/package.json +1 -1
- package/src/model.js +13 -4
- package/src/screen.js +1 -1
- package/src/tab.js +3 -1
- package/src/view/form.js +3 -5
package/package.json
CHANGED
package/src/model.js
CHANGED
|
@@ -1416,7 +1416,11 @@
|
|
|
1416
1416
|
Object.keys(this._values).reduce(function(values, name) {
|
|
1417
1417
|
var field = this.model.fields[name];
|
|
1418
1418
|
if (field) {
|
|
1419
|
-
|
|
1419
|
+
if (field instanceof Sao.field.Binary) {
|
|
1420
|
+
values[name] = field.get_size(this);
|
|
1421
|
+
} else {
|
|
1422
|
+
values[name] = field.get(this);
|
|
1423
|
+
}
|
|
1420
1424
|
}
|
|
1421
1425
|
return values;
|
|
1422
1426
|
}.bind(this), {}));
|
|
@@ -1549,12 +1553,14 @@
|
|
|
1549
1553
|
}
|
|
1550
1554
|
return value;
|
|
1551
1555
|
},
|
|
1556
|
+
_has_changed: function(previous, value) {
|
|
1557
|
+
// Use stringify to compare object instance like Number for Decimal
|
|
1558
|
+
return JSON.stringify(previous) != JSON.stringify(value);
|
|
1559
|
+
},
|
|
1552
1560
|
set_client: function(record, value, force_change) {
|
|
1553
1561
|
var previous_value = this.get(record);
|
|
1554
1562
|
this.set(record, value);
|
|
1555
|
-
|
|
1556
|
-
if (JSON.stringify(previous_value) !=
|
|
1557
|
-
JSON.stringify(this.get(record))) {
|
|
1563
|
+
if (this._has_changed(previous_value, this.get(record))) {
|
|
1558
1564
|
record._changed[this.name] = true;
|
|
1559
1565
|
this.changed(record);
|
|
1560
1566
|
record.validate(null, true, false, true);
|
|
@@ -2713,6 +2719,9 @@
|
|
|
2713
2719
|
|
|
2714
2720
|
Sao.field.Binary = Sao.class_(Sao.field.Field, {
|
|
2715
2721
|
_default: null,
|
|
2722
|
+
_has_changed: function(previous, value) {
|
|
2723
|
+
return previous != value;
|
|
2724
|
+
},
|
|
2716
2725
|
get_size: function(record) {
|
|
2717
2726
|
var data = record._values[this.name] || 0;
|
|
2718
2727
|
if (data instanceof Uint8Array) {
|
package/src/screen.js
CHANGED
|
@@ -638,7 +638,7 @@
|
|
|
638
638
|
init: function(format, id) {
|
|
639
639
|
this.format = format;
|
|
640
640
|
Sao.ScreenContainer.BetweenDates._super.init.call(this, id);
|
|
641
|
-
this.from.
|
|
641
|
+
this.from.change(this._from_changed.bind(this));
|
|
642
642
|
},
|
|
643
643
|
_get_value: function(entry, value) {
|
|
644
644
|
return entry.find('input[type=text]').val();
|
package/src/tab.js
CHANGED
|
@@ -1483,7 +1483,9 @@
|
|
|
1483
1483
|
'disabled', this.screen.readonly);
|
|
1484
1484
|
|
|
1485
1485
|
var msg = name + ' / ' + data[1];
|
|
1486
|
-
if ((data[1] < data[2]) &&
|
|
1486
|
+
if ((data[1] < data[2]) &&
|
|
1487
|
+
this.screen.limit !== null &&
|
|
1488
|
+
(data[2] > this.screen.limit)) {
|
|
1487
1489
|
msg += Sao.i18n.gettext(' of ') + data[2];
|
|
1488
1490
|
}
|
|
1489
1491
|
this.status_label.text(msg).attr('title', msg);
|
package/src/view/form.js
CHANGED
|
@@ -928,14 +928,12 @@ function eval_pyson(value){
|
|
|
928
928
|
'aria-controls': this.collapsible.attr('id'),
|
|
929
929
|
'aria-expanded': attributes.expandable == '1',
|
|
930
930
|
}).appendTo(title);
|
|
931
|
-
link.append(jQuery('<div/>', {
|
|
932
|
-
'class': 'btn btn-sm',
|
|
933
|
-
}).append(jQuery('<span/>', {
|
|
934
|
-
'class': 'caret',
|
|
935
|
-
})));
|
|
936
931
|
if (attributes.string) {
|
|
937
932
|
link.text(attributes.string);
|
|
938
933
|
}
|
|
934
|
+
link.append(jQuery('<span/>', {
|
|
935
|
+
'class': 'caret',
|
|
936
|
+
}));
|
|
939
937
|
},
|
|
940
938
|
add: function(widget) {
|
|
941
939
|
this.body.empty();
|