tryton-sao 6.0.21 → 6.0.23
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 +7 -0
- package/dist/tryton-sao.js +32 -25
- 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 +11 -8
- package/src/view/tree.js +12 -5
- package/tests/sao.js +16 -6
package/CHANGELOG
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
Version 6.0.23 - 2022-11-05
|
|
2
|
+
---------------------------
|
|
3
|
+
* Bug fixes (see mercurial logs for details)
|
|
4
|
+
|
|
5
|
+
Version 6.0.22 - 2022-10-17
|
|
6
|
+
* Bug fixes (see mercurial logs for details)
|
|
7
|
+
|
|
1
8
|
Version 6.0.21 - 2022-08-17
|
|
2
9
|
* Bug fixes (see mercurial logs for details)
|
|
3
10
|
|
package/dist/tryton-sao.js
CHANGED
|
@@ -504,8 +504,8 @@ var Sao = {};
|
|
|
504
504
|
}
|
|
505
505
|
function open_wizard(path) {
|
|
506
506
|
var attributes = {};
|
|
507
|
-
attributes.
|
|
508
|
-
if (!attributes.
|
|
507
|
+
attributes.action = path[0];
|
|
508
|
+
if (!attributes.action) {
|
|
509
509
|
return;
|
|
510
510
|
}
|
|
511
511
|
try {
|
|
@@ -3171,7 +3171,7 @@ var Sao = {};
|
|
|
3171
3171
|
|
|
3172
3172
|
Sao.common.date_format = function(format) {
|
|
3173
3173
|
if (jQuery.isEmptyObject(format)) {
|
|
3174
|
-
format = '%
|
|
3174
|
+
format = '%x';
|
|
3175
3175
|
if (Sao.Session.current_session) {
|
|
3176
3176
|
var context = Sao.Session.current_session.context;
|
|
3177
3177
|
if (context.locale && context.locale.date) {
|
|
@@ -11563,20 +11563,17 @@ var Sao = {};
|
|
|
11563
11563
|
},
|
|
11564
11564
|
_close_allowed: function() {
|
|
11565
11565
|
var wizard = this.wizard;
|
|
11566
|
-
var prm = jQuery.when();
|
|
11567
11566
|
if ((wizard.state !== wizard.end_state) &&
|
|
11568
11567
|
(wizard.end_state in wizard.states)) {
|
|
11569
|
-
|
|
11568
|
+
wizard.response(
|
|
11570
11569
|
wizard.states[wizard.end_state].attributes);
|
|
11571
11570
|
}
|
|
11572
11571
|
var dfd = jQuery.Deferred();
|
|
11573
|
-
|
|
11574
|
-
|
|
11575
|
-
|
|
11576
|
-
|
|
11577
|
-
|
|
11578
|
-
}
|
|
11579
|
-
});
|
|
11572
|
+
if (wizard.state === wizard.end_state) {
|
|
11573
|
+
dfd.resolve();
|
|
11574
|
+
} else {
|
|
11575
|
+
dfd.reject();
|
|
11576
|
+
}
|
|
11580
11577
|
return dfd.promise();
|
|
11581
11578
|
}
|
|
11582
11579
|
});
|
|
@@ -15585,7 +15582,6 @@ function eval_pyson(value){
|
|
|
15585
15582
|
_input_format: '%Y-%m-%d',
|
|
15586
15583
|
_format: Sao.common.format_date,
|
|
15587
15584
|
_parse: Sao.common.parse_date,
|
|
15588
|
-
_default_format: '%x',
|
|
15589
15585
|
init: function(view, attributes) {
|
|
15590
15586
|
Sao.View.Form.Date._super.init.call(this, view, attributes);
|
|
15591
15587
|
this.el = jQuery('<div/>', {
|
|
@@ -15617,7 +15613,10 @@ function eval_pyson(value){
|
|
|
15617
15613
|
value = this._parse(this._input_format, value);
|
|
15618
15614
|
value = this._format(this.get_format(), value);
|
|
15619
15615
|
this.date.val(value).change();
|
|
15620
|
-
|
|
15616
|
+
if (!~navigator.userAgent.indexOf("Firefox")) {
|
|
15617
|
+
// Firefox triggers change when navigate by month/year
|
|
15618
|
+
this.date.focus();
|
|
15619
|
+
}
|
|
15621
15620
|
}
|
|
15622
15621
|
}.bind(this));
|
|
15623
15622
|
if (this.input[0].type == this._input) {
|
|
@@ -15625,6 +15624,7 @@ function eval_pyson(value){
|
|
|
15625
15624
|
'class': 'icon-input icon-secondary',
|
|
15626
15625
|
'aria-label': Sao.i18n.gettext("Open the calendar"),
|
|
15627
15626
|
'title': Sao.i18n.gettext("Open the calendar"),
|
|
15627
|
+
'tabindex': -1,
|
|
15628
15628
|
}).appendTo(group);
|
|
15629
15629
|
this.input.appendTo(this.icon);
|
|
15630
15630
|
Sao.common.ICONFACTORY.get_icon_img('tryton-date')
|
|
@@ -15664,7 +15664,8 @@ function eval_pyson(value){
|
|
|
15664
15664
|
if (this.field && this.record) {
|
|
15665
15665
|
return this.field.date_format(this.record);
|
|
15666
15666
|
} else {
|
|
15667
|
-
return
|
|
15667
|
+
return Sao.common.date_format(
|
|
15668
|
+
this.view.screen.context.date_format);
|
|
15668
15669
|
}
|
|
15669
15670
|
},
|
|
15670
15671
|
get_value: function() {
|
|
@@ -15721,13 +15722,13 @@ function eval_pyson(value){
|
|
|
15721
15722
|
_input_format: '%Y-%m-%dT%H:%M:%S',
|
|
15722
15723
|
_format: Sao.common.format_datetime,
|
|
15723
15724
|
_parse: Sao.common.parse_datetime,
|
|
15724
|
-
_default_format: '%x %X',
|
|
15725
15725
|
get_format: function() {
|
|
15726
15726
|
if (this.field && this.record) {
|
|
15727
15727
|
return (this.field.date_format(this.record) + ' ' +
|
|
15728
15728
|
this.field.time_format(this.record));
|
|
15729
15729
|
} else {
|
|
15730
|
-
return
|
|
15730
|
+
return (Sao.common.date_format(
|
|
15731
|
+
this.view.screen.context.date_format) + ' %X');
|
|
15731
15732
|
}
|
|
15732
15733
|
},
|
|
15733
15734
|
cast: function(value){
|
|
@@ -15742,7 +15743,6 @@ function eval_pyson(value){
|
|
|
15742
15743
|
_input_format: '%H:%M:%S',
|
|
15743
15744
|
_format: Sao.common.format_time,
|
|
15744
15745
|
_parse: Sao.common.parse_time,
|
|
15745
|
-
_default_format: '%X',
|
|
15746
15746
|
init: function(view, attributes) {
|
|
15747
15747
|
Sao.View.Form.Time._super.init.call(this, view, attributes);
|
|
15748
15748
|
if (~navigator.userAgent.indexOf("Firefox")) {
|
|
@@ -15754,7 +15754,7 @@ function eval_pyson(value){
|
|
|
15754
15754
|
if (this.field && this.record) {
|
|
15755
15755
|
return this.field.time_format(this.record);
|
|
15756
15756
|
} else {
|
|
15757
|
-
return
|
|
15757
|
+
return '%X';
|
|
15758
15758
|
}
|
|
15759
15759
|
},
|
|
15760
15760
|
cast: function(value){
|
|
@@ -17234,7 +17234,7 @@ function eval_pyson(value){
|
|
|
17234
17234
|
size_limit = record.expr_eval(this.attributes.size);
|
|
17235
17235
|
}
|
|
17236
17236
|
if (this._readonly) {
|
|
17237
|
-
if (size_limit === null) {
|
|
17237
|
+
if ((size_limit === null) || (size_limit === undefined)) {
|
|
17238
17238
|
size_limit = this.screen.group.length;
|
|
17239
17239
|
} else {
|
|
17240
17240
|
size_limit = Math.min(
|
|
@@ -20380,12 +20380,19 @@ function eval_pyson(value){
|
|
|
20380
20380
|
var redraw = function() {
|
|
20381
20381
|
for (; i < rows.length; i++) {
|
|
20382
20382
|
var row = rows[i];
|
|
20383
|
-
var record = row.record
|
|
20384
|
-
|
|
20385
|
-
|
|
20383
|
+
var record = row.record;
|
|
20384
|
+
var field_name;
|
|
20385
|
+
for (var j=0; j < row.tree.columns.length; j++) {
|
|
20386
|
+
var column = row.tree.columns[j];
|
|
20387
|
+
if (column.type == 'field') {
|
|
20388
|
+
field_name = column.attributes.name;
|
|
20389
|
+
break;
|
|
20390
|
+
}
|
|
20391
|
+
}
|
|
20392
|
+
if (field_name && !record.is_loaded(field_name)) {
|
|
20386
20393
|
// Prefetch the first field to prevent promises in
|
|
20387
20394
|
// Cell.render
|
|
20388
|
-
record.load(
|
|
20395
|
+
record.load(field_name).done(redraw);
|
|
20389
20396
|
return;
|
|
20390
20397
|
} else {
|
|
20391
20398
|
row.redraw(selected, expanded);
|
|
@@ -20937,7 +20944,7 @@ function eval_pyson(value){
|
|
|
20937
20944
|
|
|
20938
20945
|
var current_record = this.tree.screen.current_record;
|
|
20939
20946
|
if ((this.record != current_record) &&
|
|
20940
|
-
!current_record.validate(
|
|
20947
|
+
current_record && !current_record.validate(
|
|
20941
20948
|
this.tree.get_fields(), false, false, true)) {
|
|
20942
20949
|
return;
|
|
20943
20950
|
}
|