tryton-sao 7.0.50 → 7.0.52
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 +10 -0
- package/dist/tryton-sao.js +102 -21
- 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/screen.js +3 -0
- package/src/view/form.js +39 -13
- package/src/view/list_form.js +7 -0
- package/src/view/tree.js +8 -1
- package/src/window.js +3 -2
- package/src/wizard.js +12 -3
- package/tests/sao.js +34 -0
package/CHANGELOG
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
|
|
2
|
+
Version 7.0.52 - 2026-06-18
|
|
3
|
+
---------------------------
|
|
4
|
+
* Bug fixes (see mercurial logs for details)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Version 7.0.51 - 2026-06-02
|
|
8
|
+
---------------------------
|
|
9
|
+
* Bug fixes (see mercurial logs for details)
|
|
10
|
+
|
|
11
|
+
|
|
2
12
|
Version 7.0.50 - 2026-05-20
|
|
3
13
|
---------------------------
|
|
4
14
|
* Bug fixes (see mercurial logs for details)
|
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.52',
|
|
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(
|
|
@@ -13630,6 +13658,9 @@ var Sao = {
|
|
|
13630
13658
|
});
|
|
13631
13659
|
},
|
|
13632
13660
|
get current_record() {
|
|
13661
|
+
if (this.__current_record && this.__current_record.destroyed) {
|
|
13662
|
+
this.__current_record = null;
|
|
13663
|
+
}
|
|
13633
13664
|
return this.__current_record;
|
|
13634
13665
|
},
|
|
13635
13666
|
set current_record(record) {
|
|
@@ -15179,11 +15210,12 @@ function eval_pyson(value){
|
|
|
15179
15210
|
});
|
|
15180
15211
|
for (const e of fields) {
|
|
15181
15212
|
const name = e[0];
|
|
15182
|
-
|
|
15213
|
+
if (!record.is_loaded(name)) {
|
|
15214
|
+
promesses.push(record.load(name));
|
|
15215
|
+
}
|
|
15183
15216
|
}
|
|
15184
15217
|
}
|
|
15185
|
-
|
|
15186
|
-
.then(() => {
|
|
15218
|
+
let display = function() {
|
|
15187
15219
|
let promesses = [];
|
|
15188
15220
|
var record = this.record;
|
|
15189
15221
|
for (const name in this.widgets) {
|
|
@@ -15219,7 +15251,13 @@ function eval_pyson(value){
|
|
|
15219
15251
|
container.set_grid_template();
|
|
15220
15252
|
}
|
|
15221
15253
|
});
|
|
15222
|
-
});
|
|
15254
|
+
}.bind(this);
|
|
15255
|
+
if (promesses.length) {
|
|
15256
|
+
return jQuery.when.apply(jQuery, promesses).then(
|
|
15257
|
+
() => display());
|
|
15258
|
+
} else {
|
|
15259
|
+
return display();
|
|
15260
|
+
}
|
|
15223
15261
|
},
|
|
15224
15262
|
set_value: function() {
|
|
15225
15263
|
var record = this.record;
|
|
@@ -18168,7 +18206,11 @@ function eval_pyson(value){
|
|
|
18168
18206
|
},
|
|
18169
18207
|
set_readonly: function(readonly) {
|
|
18170
18208
|
Sao.View.Form.One2Many._super.set_readonly.call(this, readonly);
|
|
18171
|
-
this.prm.
|
|
18209
|
+
if (this.prm.state() == 'pending') {
|
|
18210
|
+
this.prm.done(() => this._set_button_sensitive());
|
|
18211
|
+
} else {
|
|
18212
|
+
this._set_button_sensitive();
|
|
18213
|
+
}
|
|
18172
18214
|
this._set_label_state();
|
|
18173
18215
|
},
|
|
18174
18216
|
set_required: function(required) {
|
|
@@ -18256,7 +18298,7 @@ function eval_pyson(value){
|
|
|
18256
18298
|
display: function() {
|
|
18257
18299
|
Sao.View.Form.One2Many._super.display.call(this);
|
|
18258
18300
|
|
|
18259
|
-
|
|
18301
|
+
let display = function() {
|
|
18260
18302
|
this._set_button_sensitive();
|
|
18261
18303
|
|
|
18262
18304
|
var record = this.record;
|
|
@@ -18302,7 +18344,13 @@ function eval_pyson(value){
|
|
|
18302
18344
|
.css('max-height', this.attributes.height + 'px');
|
|
18303
18345
|
}
|
|
18304
18346
|
return this.screen.display();
|
|
18305
|
-
});
|
|
18347
|
+
}.bind(this);
|
|
18348
|
+
|
|
18349
|
+
if (this.prm.state() == 'pending') {
|
|
18350
|
+
return this.prm.then(() => display());
|
|
18351
|
+
} else {
|
|
18352
|
+
return display();
|
|
18353
|
+
}
|
|
18306
18354
|
},
|
|
18307
18355
|
focus: function() {
|
|
18308
18356
|
if (this.attributes.add_remove) {
|
|
@@ -18548,7 +18596,11 @@ function eval_pyson(value){
|
|
|
18548
18596
|
}
|
|
18549
18597
|
var message = name + ' / ' + Sao.common.humanize(size);
|
|
18550
18598
|
this.label.text(message).attr('title', message);
|
|
18551
|
-
this.prm.
|
|
18599
|
+
if (this.prm.state() == 'pending') {
|
|
18600
|
+
this.prm.done(() => this._set_button_sensitive());
|
|
18601
|
+
} else {
|
|
18602
|
+
this._set_button_sensitive();
|
|
18603
|
+
}
|
|
18552
18604
|
},
|
|
18553
18605
|
validate: function() {
|
|
18554
18606
|
var prm = jQuery.Deferred();
|
|
@@ -18558,9 +18610,8 @@ function eval_pyson(value){
|
|
|
18558
18610
|
var fields = this.screen.current_view.get_fields();
|
|
18559
18611
|
record.validate(fields).then(validate => {
|
|
18560
18612
|
if (!validate) {
|
|
18561
|
-
this.screen.display(true);
|
|
18562
|
-
prm
|
|
18563
|
-
return;
|
|
18613
|
+
this.screen.display(true).always(() => prm.reject());
|
|
18614
|
+
return prm;
|
|
18564
18615
|
}
|
|
18565
18616
|
if (this.screen.pre_validate) {
|
|
18566
18617
|
return record.pre_validate().then(
|
|
@@ -18778,7 +18829,7 @@ function eval_pyson(value){
|
|
|
18778
18829
|
display: function() {
|
|
18779
18830
|
Sao.View.Form.Many2Many._super.display.call(this);
|
|
18780
18831
|
|
|
18781
|
-
|
|
18832
|
+
let display = function() {
|
|
18782
18833
|
var record = this.record;
|
|
18783
18834
|
var field = this.field;
|
|
18784
18835
|
|
|
@@ -18799,7 +18850,13 @@ function eval_pyson(value){
|
|
|
18799
18850
|
.css('max-height', this.attributes.height + 'px');
|
|
18800
18851
|
}
|
|
18801
18852
|
return this.screen.display();
|
|
18802
|
-
});
|
|
18853
|
+
}.bind(this);
|
|
18854
|
+
|
|
18855
|
+
if (this.prm.state() == 'pending') {
|
|
18856
|
+
return this.prm.then(() => display());
|
|
18857
|
+
} else {
|
|
18858
|
+
return display();
|
|
18859
|
+
}
|
|
18803
18860
|
},
|
|
18804
18861
|
focus: function() {
|
|
18805
18862
|
this.entry.focus();
|
|
@@ -21686,6 +21743,13 @@ function eval_pyson(value){
|
|
|
21686
21743
|
this.display_size = this.group.length;
|
|
21687
21744
|
this.display();
|
|
21688
21745
|
}
|
|
21746
|
+
if (reset_view) {
|
|
21747
|
+
let current_path = this.record.get_path(this.group);
|
|
21748
|
+
current_path = current_path.map(function(e) {
|
|
21749
|
+
return e[1];
|
|
21750
|
+
});
|
|
21751
|
+
this.display([current_path]);
|
|
21752
|
+
}
|
|
21689
21753
|
if (path.length > 1) {
|
|
21690
21754
|
prm = this.rows[path[0]].expand_to_path(
|
|
21691
21755
|
path.slice(1),
|
|
@@ -22932,7 +22996,7 @@ function eval_pyson(value){
|
|
|
22932
22996
|
fields, false, false, true)) {
|
|
22933
22997
|
var value = cell.prop('checked');
|
|
22934
22998
|
this.field.set_client(record, value);
|
|
22935
|
-
if (record !== current_record) {
|
|
22999
|
+
if ((!this.group.parent) & (record !== current_record)) {
|
|
22936
23000
|
// we can not rely on editable tree handler to save the row
|
|
22937
23001
|
record.save();
|
|
22938
23002
|
}
|
|
@@ -24436,6 +24500,7 @@ function eval_pyson(value){
|
|
|
24436
24500
|
},
|
|
24437
24501
|
button_clicked: function(event) {
|
|
24438
24502
|
if (Sao.common.compare(this.screen.selected_records, [this.record])) {
|
|
24503
|
+
event.stopPropagation();
|
|
24439
24504
|
Sao.View.ListGroupViewForm._super.button_clicked.call(this, event);
|
|
24440
24505
|
}
|
|
24441
24506
|
}
|
|
@@ -24538,6 +24603,12 @@ function eval_pyson(value){
|
|
|
24538
24603
|
return this.group.slice();
|
|
24539
24604
|
},
|
|
24540
24605
|
set_cursor: function(new_, reset_view) {
|
|
24606
|
+
if (!this.record) {
|
|
24607
|
+
return;
|
|
24608
|
+
}
|
|
24609
|
+
if (reset_view) {
|
|
24610
|
+
this.display([this.record.id]);
|
|
24611
|
+
}
|
|
24541
24612
|
if (new_) {
|
|
24542
24613
|
this.el.animate({
|
|
24543
24614
|
scrollTop: this.el[0].scrollHeight
|
|
@@ -27389,15 +27460,16 @@ function eval_pyson(value){
|
|
|
27389
27460
|
},
|
|
27390
27461
|
_fill_with: function(template) {
|
|
27391
27462
|
var prm;
|
|
27463
|
+
let context = this.record.get_context();
|
|
27392
27464
|
if (template) {
|
|
27393
27465
|
prm = Sao.rpc({
|
|
27394
27466
|
'method': 'model.ir.email.template.get',
|
|
27395
|
-
'params': [template, this.record.id,
|
|
27467
|
+
'params': [template, this.record.id, context],
|
|
27396
27468
|
}, this.record.model.session);
|
|
27397
27469
|
} else {
|
|
27398
27470
|
prm = Sao.rpc({
|
|
27399
27471
|
'method': 'model.ir.email.template.get_default',
|
|
27400
|
-
'params': [this.record.model.name, this.record.id,
|
|
27472
|
+
'params': [this.record.model.name, this.record.id, context],
|
|
27401
27473
|
}, this.record.model.session);
|
|
27402
27474
|
}
|
|
27403
27475
|
prm.then(values => {
|
|
@@ -27643,6 +27715,7 @@ function eval_pyson(value){
|
|
|
27643
27715
|
if (this.__processing || this.__waiting_response) {
|
|
27644
27716
|
return;
|
|
27645
27717
|
}
|
|
27718
|
+
this.__processing = true;
|
|
27646
27719
|
var process = function() {
|
|
27647
27720
|
if (this.state == this.end_state) {
|
|
27648
27721
|
this.end();
|
|
@@ -27820,11 +27893,14 @@ function eval_pyson(value){
|
|
|
27820
27893
|
this.footer.empty();
|
|
27821
27894
|
},
|
|
27822
27895
|
_get_button: function(definition) {
|
|
27896
|
+
let state = this.state;
|
|
27823
27897
|
var button = Sao.Wizard.Form._super._get_button.call(this,
|
|
27824
27898
|
definition);
|
|
27825
27899
|
this.footer.append(button.el);
|
|
27826
27900
|
button.el.click(() => {
|
|
27827
|
-
this.
|
|
27901
|
+
if (this.state === state) {
|
|
27902
|
+
this.response(definition);
|
|
27903
|
+
}
|
|
27828
27904
|
});
|
|
27829
27905
|
return button;
|
|
27830
27906
|
},
|
|
@@ -27872,19 +27948,24 @@ function eval_pyson(value){
|
|
|
27872
27948
|
this.footer.empty();
|
|
27873
27949
|
},
|
|
27874
27950
|
_get_button: function(definition) {
|
|
27951
|
+
let state = this.state;
|
|
27875
27952
|
var button = Sao.Wizard.Dialog._super._get_button.call(this,
|
|
27876
27953
|
definition);
|
|
27877
27954
|
this.footer.append(button.el);
|
|
27878
27955
|
if (definition['default']) {
|
|
27879
27956
|
this.content.unbind('submit');
|
|
27880
27957
|
this.content.submit(e => {
|
|
27881
|
-
this.response(definition);
|
|
27882
27958
|
e.preventDefault();
|
|
27959
|
+
if (this.state === state) {
|
|
27960
|
+
this.response(definition);
|
|
27961
|
+
}
|
|
27883
27962
|
});
|
|
27884
27963
|
button.el.attr('type', 'submit');
|
|
27885
27964
|
} else {
|
|
27886
27965
|
button.el.click(() => {
|
|
27887
|
-
this.
|
|
27966
|
+
if (this.state === state) {
|
|
27967
|
+
this.response(definition);
|
|
27968
|
+
}
|
|
27888
27969
|
});
|
|
27889
27970
|
}
|
|
27890
27971
|
return button;
|