tryton-sao 7.0.51 → 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 +5 -0
- package/dist/tryton-sao.js +57 -13
- package/dist/tryton-sao.min.js +2 -2
- package/package.json +1 -1
- package/src/sao.js +1 -1
- package/src/screen.js +3 -0
- package/src/view/form.js +37 -10
- package/src/view/list_form.js +6 -0
- package/src/view/tree.js +7 -0
- package/src/window.js +3 -2
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.52',
|
|
7
7
|
};
|
|
8
8
|
/* eslint-enable no-redeclare */
|
|
9
9
|
|
|
@@ -13658,6 +13658,9 @@ var Sao = {
|
|
|
13658
13658
|
});
|
|
13659
13659
|
},
|
|
13660
13660
|
get current_record() {
|
|
13661
|
+
if (this.__current_record && this.__current_record.destroyed) {
|
|
13662
|
+
this.__current_record = null;
|
|
13663
|
+
}
|
|
13661
13664
|
return this.__current_record;
|
|
13662
13665
|
},
|
|
13663
13666
|
set current_record(record) {
|
|
@@ -15207,11 +15210,12 @@ function eval_pyson(value){
|
|
|
15207
15210
|
});
|
|
15208
15211
|
for (const e of fields) {
|
|
15209
15212
|
const name = e[0];
|
|
15210
|
-
|
|
15213
|
+
if (!record.is_loaded(name)) {
|
|
15214
|
+
promesses.push(record.load(name));
|
|
15215
|
+
}
|
|
15211
15216
|
}
|
|
15212
15217
|
}
|
|
15213
|
-
|
|
15214
|
-
.then(() => {
|
|
15218
|
+
let display = function() {
|
|
15215
15219
|
let promesses = [];
|
|
15216
15220
|
var record = this.record;
|
|
15217
15221
|
for (const name in this.widgets) {
|
|
@@ -15247,7 +15251,13 @@ function eval_pyson(value){
|
|
|
15247
15251
|
container.set_grid_template();
|
|
15248
15252
|
}
|
|
15249
15253
|
});
|
|
15250
|
-
});
|
|
15254
|
+
}.bind(this);
|
|
15255
|
+
if (promesses.length) {
|
|
15256
|
+
return jQuery.when.apply(jQuery, promesses).then(
|
|
15257
|
+
() => display());
|
|
15258
|
+
} else {
|
|
15259
|
+
return display();
|
|
15260
|
+
}
|
|
15251
15261
|
},
|
|
15252
15262
|
set_value: function() {
|
|
15253
15263
|
var record = this.record;
|
|
@@ -18196,7 +18206,11 @@ function eval_pyson(value){
|
|
|
18196
18206
|
},
|
|
18197
18207
|
set_readonly: function(readonly) {
|
|
18198
18208
|
Sao.View.Form.One2Many._super.set_readonly.call(this, readonly);
|
|
18199
|
-
this.prm.
|
|
18209
|
+
if (this.prm.state() == 'pending') {
|
|
18210
|
+
this.prm.done(() => this._set_button_sensitive());
|
|
18211
|
+
} else {
|
|
18212
|
+
this._set_button_sensitive();
|
|
18213
|
+
}
|
|
18200
18214
|
this._set_label_state();
|
|
18201
18215
|
},
|
|
18202
18216
|
set_required: function(required) {
|
|
@@ -18284,7 +18298,7 @@ function eval_pyson(value){
|
|
|
18284
18298
|
display: function() {
|
|
18285
18299
|
Sao.View.Form.One2Many._super.display.call(this);
|
|
18286
18300
|
|
|
18287
|
-
|
|
18301
|
+
let display = function() {
|
|
18288
18302
|
this._set_button_sensitive();
|
|
18289
18303
|
|
|
18290
18304
|
var record = this.record;
|
|
@@ -18330,7 +18344,13 @@ function eval_pyson(value){
|
|
|
18330
18344
|
.css('max-height', this.attributes.height + 'px');
|
|
18331
18345
|
}
|
|
18332
18346
|
return this.screen.display();
|
|
18333
|
-
});
|
|
18347
|
+
}.bind(this);
|
|
18348
|
+
|
|
18349
|
+
if (this.prm.state() == 'pending') {
|
|
18350
|
+
return this.prm.then(() => display());
|
|
18351
|
+
} else {
|
|
18352
|
+
return display();
|
|
18353
|
+
}
|
|
18334
18354
|
},
|
|
18335
18355
|
focus: function() {
|
|
18336
18356
|
if (this.attributes.add_remove) {
|
|
@@ -18576,7 +18596,11 @@ function eval_pyson(value){
|
|
|
18576
18596
|
}
|
|
18577
18597
|
var message = name + ' / ' + Sao.common.humanize(size);
|
|
18578
18598
|
this.label.text(message).attr('title', message);
|
|
18579
|
-
this.prm.
|
|
18599
|
+
if (this.prm.state() == 'pending') {
|
|
18600
|
+
this.prm.done(() => this._set_button_sensitive());
|
|
18601
|
+
} else {
|
|
18602
|
+
this._set_button_sensitive();
|
|
18603
|
+
}
|
|
18580
18604
|
},
|
|
18581
18605
|
validate: function() {
|
|
18582
18606
|
var prm = jQuery.Deferred();
|
|
@@ -18805,7 +18829,7 @@ function eval_pyson(value){
|
|
|
18805
18829
|
display: function() {
|
|
18806
18830
|
Sao.View.Form.Many2Many._super.display.call(this);
|
|
18807
18831
|
|
|
18808
|
-
|
|
18832
|
+
let display = function() {
|
|
18809
18833
|
var record = this.record;
|
|
18810
18834
|
var field = this.field;
|
|
18811
18835
|
|
|
@@ -18826,7 +18850,13 @@ function eval_pyson(value){
|
|
|
18826
18850
|
.css('max-height', this.attributes.height + 'px');
|
|
18827
18851
|
}
|
|
18828
18852
|
return this.screen.display();
|
|
18829
|
-
});
|
|
18853
|
+
}.bind(this);
|
|
18854
|
+
|
|
18855
|
+
if (this.prm.state() == 'pending') {
|
|
18856
|
+
return this.prm.then(() => display());
|
|
18857
|
+
} else {
|
|
18858
|
+
return display();
|
|
18859
|
+
}
|
|
18830
18860
|
},
|
|
18831
18861
|
focus: function() {
|
|
18832
18862
|
this.entry.focus();
|
|
@@ -21713,6 +21743,13 @@ function eval_pyson(value){
|
|
|
21713
21743
|
this.display_size = this.group.length;
|
|
21714
21744
|
this.display();
|
|
21715
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
|
+
}
|
|
21716
21753
|
if (path.length > 1) {
|
|
21717
21754
|
prm = this.rows[path[0]].expand_to_path(
|
|
21718
21755
|
path.slice(1),
|
|
@@ -24566,6 +24603,12 @@ function eval_pyson(value){
|
|
|
24566
24603
|
return this.group.slice();
|
|
24567
24604
|
},
|
|
24568
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
|
+
}
|
|
24569
24612
|
if (new_) {
|
|
24570
24613
|
this.el.animate({
|
|
24571
24614
|
scrollTop: this.el[0].scrollHeight
|
|
@@ -27417,15 +27460,16 @@ function eval_pyson(value){
|
|
|
27417
27460
|
},
|
|
27418
27461
|
_fill_with: function(template) {
|
|
27419
27462
|
var prm;
|
|
27463
|
+
let context = this.record.get_context();
|
|
27420
27464
|
if (template) {
|
|
27421
27465
|
prm = Sao.rpc({
|
|
27422
27466
|
'method': 'model.ir.email.template.get',
|
|
27423
|
-
'params': [template, this.record.id,
|
|
27467
|
+
'params': [template, this.record.id, context],
|
|
27424
27468
|
}, this.record.model.session);
|
|
27425
27469
|
} else {
|
|
27426
27470
|
prm = Sao.rpc({
|
|
27427
27471
|
'method': 'model.ir.email.template.get_default',
|
|
27428
|
-
'params': [this.record.model.name, this.record.id,
|
|
27472
|
+
'params': [this.record.model.name, this.record.id, context],
|
|
27429
27473
|
}, this.record.model.session);
|
|
27430
27474
|
}
|
|
27431
27475
|
prm.then(values => {
|