tryton-sao 6.0.21 → 6.0.22
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 +14 -18
- package/dist/tryton-sao.min.js +2 -2
- package/package.json +1 -1
- package/src/common.js +1 -1
- package/src/sao.js +2 -2
- package/src/tab.js +6 -9
- package/src/view/form.js +5 -6
- package/tests/sao.js +16 -6
package/package.json
CHANGED
package/src/common.js
CHANGED
|
@@ -226,7 +226,7 @@
|
|
|
226
226
|
|
|
227
227
|
Sao.common.date_format = function(format) {
|
|
228
228
|
if (jQuery.isEmptyObject(format)) {
|
|
229
|
-
format = '%
|
|
229
|
+
format = '%x';
|
|
230
230
|
if (Sao.Session.current_session) {
|
|
231
231
|
var context = Sao.Session.current_session.context;
|
|
232
232
|
if (context.locale && context.locale.date) {
|
package/src/sao.js
CHANGED
package/src/tab.js
CHANGED
|
@@ -1668,20 +1668,17 @@
|
|
|
1668
1668
|
},
|
|
1669
1669
|
_close_allowed: function() {
|
|
1670
1670
|
var wizard = this.wizard;
|
|
1671
|
-
var prm = jQuery.when();
|
|
1672
1671
|
if ((wizard.state !== wizard.end_state) &&
|
|
1673
1672
|
(wizard.end_state in wizard.states)) {
|
|
1674
|
-
|
|
1673
|
+
wizard.response(
|
|
1675
1674
|
wizard.states[wizard.end_state].attributes);
|
|
1676
1675
|
}
|
|
1677
1676
|
var dfd = jQuery.Deferred();
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
}
|
|
1684
|
-
});
|
|
1677
|
+
if (wizard.state === wizard.end_state) {
|
|
1678
|
+
dfd.resolve();
|
|
1679
|
+
} else {
|
|
1680
|
+
dfd.reject();
|
|
1681
|
+
}
|
|
1685
1682
|
return dfd.promise();
|
|
1686
1683
|
}
|
|
1687
1684
|
});
|
package/src/view/form.js
CHANGED
|
@@ -1594,7 +1594,6 @@ function eval_pyson(value){
|
|
|
1594
1594
|
_input_format: '%Y-%m-%d',
|
|
1595
1595
|
_format: Sao.common.format_date,
|
|
1596
1596
|
_parse: Sao.common.parse_date,
|
|
1597
|
-
_default_format: '%x',
|
|
1598
1597
|
init: function(view, attributes) {
|
|
1599
1598
|
Sao.View.Form.Date._super.init.call(this, view, attributes);
|
|
1600
1599
|
this.el = jQuery('<div/>', {
|
|
@@ -1673,7 +1672,8 @@ function eval_pyson(value){
|
|
|
1673
1672
|
if (this.field && this.record) {
|
|
1674
1673
|
return this.field.date_format(this.record);
|
|
1675
1674
|
} else {
|
|
1676
|
-
return
|
|
1675
|
+
return Sao.common.date_format(
|
|
1676
|
+
this.view.screen.context.date_format);
|
|
1677
1677
|
}
|
|
1678
1678
|
},
|
|
1679
1679
|
get_value: function() {
|
|
@@ -1730,13 +1730,13 @@ function eval_pyson(value){
|
|
|
1730
1730
|
_input_format: '%Y-%m-%dT%H:%M:%S',
|
|
1731
1731
|
_format: Sao.common.format_datetime,
|
|
1732
1732
|
_parse: Sao.common.parse_datetime,
|
|
1733
|
-
_default_format: '%x %X',
|
|
1734
1733
|
get_format: function() {
|
|
1735
1734
|
if (this.field && this.record) {
|
|
1736
1735
|
return (this.field.date_format(this.record) + ' ' +
|
|
1737
1736
|
this.field.time_format(this.record));
|
|
1738
1737
|
} else {
|
|
1739
|
-
return
|
|
1738
|
+
return (Sao.common.date_format(
|
|
1739
|
+
this.view.screen.context.date_format) + ' %X');
|
|
1740
1740
|
}
|
|
1741
1741
|
},
|
|
1742
1742
|
cast: function(value){
|
|
@@ -1751,7 +1751,6 @@ function eval_pyson(value){
|
|
|
1751
1751
|
_input_format: '%H:%M:%S',
|
|
1752
1752
|
_format: Sao.common.format_time,
|
|
1753
1753
|
_parse: Sao.common.parse_time,
|
|
1754
|
-
_default_format: '%X',
|
|
1755
1754
|
init: function(view, attributes) {
|
|
1756
1755
|
Sao.View.Form.Time._super.init.call(this, view, attributes);
|
|
1757
1756
|
if (~navigator.userAgent.indexOf("Firefox")) {
|
|
@@ -1763,7 +1762,7 @@ function eval_pyson(value){
|
|
|
1763
1762
|
if (this.field && this.record) {
|
|
1764
1763
|
return this.field.time_format(this.record);
|
|
1765
1764
|
} else {
|
|
1766
|
-
return
|
|
1765
|
+
return '%X';
|
|
1767
1766
|
}
|
|
1768
1767
|
},
|
|
1769
1768
|
cast: function(value){
|
package/tests/sao.js
CHANGED
|
@@ -1626,22 +1626,27 @@
|
|
|
1626
1626
|
|
|
1627
1627
|
QUnit.test('DomainParser.convert_value', function() {
|
|
1628
1628
|
var parser = new Sao.common.DomainParser();
|
|
1629
|
+
var context = {
|
|
1630
|
+
'date_format': '%Y-%m-%d',
|
|
1631
|
+
};
|
|
1629
1632
|
|
|
1630
1633
|
var test_func = function(test) {
|
|
1631
1634
|
var value = test[0];
|
|
1632
1635
|
var result = test[1];
|
|
1633
|
-
QUnit.strictEqual(
|
|
1636
|
+
QUnit.strictEqual(
|
|
1637
|
+
parser.convert_value(this, value, context), result,
|
|
1634
1638
|
'convert_value(' + JSON.stringify(this) + ', ' +
|
|
1635
|
-
|
|
1639
|
+
JSON.stringify(value) + ', ' + JSON.stringify(context) + ')');
|
|
1636
1640
|
};
|
|
1637
1641
|
|
|
1638
1642
|
var test_valueOf_func = function(test) {
|
|
1639
1643
|
var value = test[0];
|
|
1640
1644
|
var result = test[1];
|
|
1641
|
-
QUnit.strictEqual(
|
|
1645
|
+
QUnit.strictEqual(
|
|
1646
|
+
parser.convert_value(this, value, context).valueOf(),
|
|
1642
1647
|
result.valueOf(),
|
|
1643
1648
|
'convert_value(' + JSON.stringify(this) + ', ' +
|
|
1644
|
-
|
|
1649
|
+
JSON.stringify(value) + ', ' + JSON.stringify(context) + ')');
|
|
1645
1650
|
};
|
|
1646
1651
|
|
|
1647
1652
|
var field = {
|
|
@@ -1915,13 +1920,18 @@
|
|
|
1915
1920
|
|
|
1916
1921
|
QUnit.test('DomainParser.format_value', function() {
|
|
1917
1922
|
var parser = new Sao.common.DomainParser();
|
|
1923
|
+
var context = {
|
|
1924
|
+
'date_format': '%Y-%m-%d',
|
|
1925
|
+
};
|
|
1918
1926
|
|
|
1919
1927
|
var test_func = function(test) {
|
|
1920
1928
|
var value = test[0];
|
|
1921
1929
|
var result = test[1];
|
|
1922
|
-
QUnit.strictEqual(
|
|
1930
|
+
QUnit.strictEqual(
|
|
1931
|
+
parser.format_value(this, value, null, context), result,
|
|
1923
1932
|
'format_value(' + JSON.stringify(this) + ', ' +
|
|
1924
|
-
|
|
1933
|
+
JSON.stringify(value) + ', null, ' + JSON.stringify(context) +
|
|
1934
|
+
')');
|
|
1925
1935
|
};
|
|
1926
1936
|
|
|
1927
1937
|
var field = {
|