tryton-sao 7.0.50 → 7.0.51
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 +5 -0
- package/dist/tryton-sao.js +46 -9
- package/dist/tryton-sao.min.js +2 -2
- package/package.json +1 -1
- package/src/common.js +29 -1
- package/src/sao.js +1 -1
- package/src/view/form.js +2 -3
- package/src/view/list_form.js +1 -0
- package/src/view/tree.js +1 -1
- package/src/wizard.js +12 -3
- package/tests/sao.js +34 -0
package/CHANGELOG
CHANGED
package/dist/tryton-sao.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
/* eslint-disable no-redeclare */
|
|
5
5
|
var Sao = {
|
|
6
|
-
__version__: '7.0.
|
|
6
|
+
__version__: '7.0.51',
|
|
7
7
|
};
|
|
8
8
|
/* eslint-enable no-redeclare */
|
|
9
9
|
|
|
@@ -4809,7 +4809,9 @@ var Sao = {
|
|
|
4809
4809
|
};
|
|
4810
4810
|
|
|
4811
4811
|
var complete_datetime = function() {
|
|
4812
|
-
return [Sao.Date(), Sao.DateTime(
|
|
4812
|
+
return [Sao.Date(), Sao.DateTime(
|
|
4813
|
+
undefined, undefined, undefined,
|
|
4814
|
+
0, 0, 0, 0, true)];
|
|
4813
4815
|
};
|
|
4814
4816
|
|
|
4815
4817
|
var complete_date = function() {
|
|
@@ -5118,6 +5120,32 @@ var Sao = {
|
|
|
5118
5120
|
]);
|
|
5119
5121
|
return;
|
|
5120
5122
|
}
|
|
5123
|
+
if ((typeof value == 'string') &&
|
|
5124
|
+
['datetime', 'timestamp'].includes(field.type) &&
|
|
5125
|
+
(operator == '=')) {
|
|
5126
|
+
let ctx, format_, parsed_date;
|
|
5127
|
+
if (this.context && Object.keys(this.context).length) {
|
|
5128
|
+
ctx = this.context;
|
|
5129
|
+
} else {
|
|
5130
|
+
ctx = {};
|
|
5131
|
+
}
|
|
5132
|
+
format_ = Sao.common.date_format(ctx.date_format);
|
|
5133
|
+
parsed_date = Sao.common.parse_date(format_, value);
|
|
5134
|
+
if (parsed_date &&
|
|
5135
|
+
(Sao.common.format_date(format_, parsed_date) == value)) {
|
|
5136
|
+
let date = Sao.DateTime.combine(parsed_date, Sao.Time());
|
|
5137
|
+
let next_day = Sao.DateTime(
|
|
5138
|
+
date.year(), date.month(), date.date(),
|
|
5139
|
+
date.hour(), date.minute(), date.second(),
|
|
5140
|
+
date.millisecond())
|
|
5141
|
+
next_day.add(1, 'day');
|
|
5142
|
+
result.push(this._clausify([
|
|
5143
|
+
[field_name, '>=', date],
|
|
5144
|
+
[field_name, '<', next_day]
|
|
5145
|
+
]));
|
|
5146
|
+
return;
|
|
5147
|
+
}
|
|
5148
|
+
}
|
|
5121
5149
|
}
|
|
5122
5150
|
if (value instanceof Array) {
|
|
5123
5151
|
value = value.map(
|
|
@@ -18558,9 +18586,8 @@ function eval_pyson(value){
|
|
|
18558
18586
|
var fields = this.screen.current_view.get_fields();
|
|
18559
18587
|
record.validate(fields).then(validate => {
|
|
18560
18588
|
if (!validate) {
|
|
18561
|
-
this.screen.display(true);
|
|
18562
|
-
prm
|
|
18563
|
-
return;
|
|
18589
|
+
this.screen.display(true).always(() => prm.reject());
|
|
18590
|
+
return prm;
|
|
18564
18591
|
}
|
|
18565
18592
|
if (this.screen.pre_validate) {
|
|
18566
18593
|
return record.pre_validate().then(
|
|
@@ -22932,7 +22959,7 @@ function eval_pyson(value){
|
|
|
22932
22959
|
fields, false, false, true)) {
|
|
22933
22960
|
var value = cell.prop('checked');
|
|
22934
22961
|
this.field.set_client(record, value);
|
|
22935
|
-
if (record !== current_record) {
|
|
22962
|
+
if ((!this.group.parent) & (record !== current_record)) {
|
|
22936
22963
|
// we can not rely on editable tree handler to save the row
|
|
22937
22964
|
record.save();
|
|
22938
22965
|
}
|
|
@@ -24436,6 +24463,7 @@ function eval_pyson(value){
|
|
|
24436
24463
|
},
|
|
24437
24464
|
button_clicked: function(event) {
|
|
24438
24465
|
if (Sao.common.compare(this.screen.selected_records, [this.record])) {
|
|
24466
|
+
event.stopPropagation();
|
|
24439
24467
|
Sao.View.ListGroupViewForm._super.button_clicked.call(this, event);
|
|
24440
24468
|
}
|
|
24441
24469
|
}
|
|
@@ -27643,6 +27671,7 @@ function eval_pyson(value){
|
|
|
27643
27671
|
if (this.__processing || this.__waiting_response) {
|
|
27644
27672
|
return;
|
|
27645
27673
|
}
|
|
27674
|
+
this.__processing = true;
|
|
27646
27675
|
var process = function() {
|
|
27647
27676
|
if (this.state == this.end_state) {
|
|
27648
27677
|
this.end();
|
|
@@ -27820,11 +27849,14 @@ function eval_pyson(value){
|
|
|
27820
27849
|
this.footer.empty();
|
|
27821
27850
|
},
|
|
27822
27851
|
_get_button: function(definition) {
|
|
27852
|
+
let state = this.state;
|
|
27823
27853
|
var button = Sao.Wizard.Form._super._get_button.call(this,
|
|
27824
27854
|
definition);
|
|
27825
27855
|
this.footer.append(button.el);
|
|
27826
27856
|
button.el.click(() => {
|
|
27827
|
-
this.
|
|
27857
|
+
if (this.state === state) {
|
|
27858
|
+
this.response(definition);
|
|
27859
|
+
}
|
|
27828
27860
|
});
|
|
27829
27861
|
return button;
|
|
27830
27862
|
},
|
|
@@ -27872,19 +27904,24 @@ function eval_pyson(value){
|
|
|
27872
27904
|
this.footer.empty();
|
|
27873
27905
|
},
|
|
27874
27906
|
_get_button: function(definition) {
|
|
27907
|
+
let state = this.state;
|
|
27875
27908
|
var button = Sao.Wizard.Dialog._super._get_button.call(this,
|
|
27876
27909
|
definition);
|
|
27877
27910
|
this.footer.append(button.el);
|
|
27878
27911
|
if (definition['default']) {
|
|
27879
27912
|
this.content.unbind('submit');
|
|
27880
27913
|
this.content.submit(e => {
|
|
27881
|
-
this.response(definition);
|
|
27882
27914
|
e.preventDefault();
|
|
27915
|
+
if (this.state === state) {
|
|
27916
|
+
this.response(definition);
|
|
27917
|
+
}
|
|
27883
27918
|
});
|
|
27884
27919
|
button.el.attr('type', 'submit');
|
|
27885
27920
|
} else {
|
|
27886
27921
|
button.el.click(() => {
|
|
27887
|
-
this.
|
|
27922
|
+
if (this.state === state) {
|
|
27923
|
+
this.response(definition);
|
|
27924
|
+
}
|
|
27888
27925
|
});
|
|
27889
27926
|
}
|
|
27890
27927
|
return button;
|