tryton-sao 6.0.13 → 6.0.16
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 +9 -0
- package/Gruntfile.js +1 -0
- package/dist/tryton-sao.js +42 -41
- package/dist/tryton-sao.min.js +2 -2
- package/package.json +1 -1
- package/src/common.js +2 -2
- package/src/model.js +9 -25
- package/src/pyson.js +7 -3
- package/src/rpc.js +1 -1
- package/src/screen.js +3 -2
- package/src/tab.js +12 -5
- package/src/view/form.js +1 -0
- package/src/view/tree.js +7 -3
- package/tests/sao.js +6 -0
package/CHANGELOG
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
Version 6.0.16 - 2022-04-15
|
|
2
|
+
* Bug fixes (see mercurial logs for details)
|
|
3
|
+
|
|
4
|
+
Version 6.0.15 - 2022-03-01
|
|
5
|
+
* Bug fixes (see mercurial logs for details)
|
|
6
|
+
|
|
7
|
+
Version 6.0.14 - 2022-02-16
|
|
8
|
+
* Bug fixes (see mercurial logs for details)
|
|
9
|
+
|
|
1
10
|
Version 6.0.13 - 2022-02-01
|
|
2
11
|
* Bug fixes (see mercurial logs for details)
|
|
3
12
|
|
package/Gruntfile.js
CHANGED
package/dist/tryton-sao.js
CHANGED
|
@@ -1244,7 +1244,7 @@ var Sao = {};
|
|
|
1244
1244
|
name = data.error[1][0];
|
|
1245
1245
|
msg = data.error[1][1];
|
|
1246
1246
|
description = data.error[1][2];
|
|
1247
|
-
Sao.common.userwarning.run(
|
|
1247
|
+
Sao.common.userwarning.run(description, msg)
|
|
1248
1248
|
.then(function(result) {
|
|
1249
1249
|
if (!~['always', 'ok'].indexOf(result)) {
|
|
1250
1250
|
dfd.reject();
|
|
@@ -2194,10 +2194,14 @@ var Sao = {};
|
|
|
2194
2194
|
});
|
|
2195
2195
|
|
|
2196
2196
|
Sao.PYSON.In.eval_ = function(value, context) {
|
|
2197
|
-
if (value.v
|
|
2198
|
-
|
|
2197
|
+
if (value.v) {
|
|
2198
|
+
if (value.v.indexOf) {
|
|
2199
|
+
return Boolean(~value.v.indexOf(value.k));
|
|
2200
|
+
} else {
|
|
2201
|
+
return !!value.v[value.k];
|
|
2202
|
+
}
|
|
2199
2203
|
} else {
|
|
2200
|
-
return
|
|
2204
|
+
return false;
|
|
2201
2205
|
}
|
|
2202
2206
|
};
|
|
2203
2207
|
Sao.PYSON.In.init_from_object = function(obj) {
|
|
@@ -6114,8 +6118,8 @@ var Sao = {};
|
|
|
6114
6118
|
dialog.body.append(jQuery('<div/>', {
|
|
6115
6119
|
'class': 'checkbox',
|
|
6116
6120
|
}).append(jQuery('<label/>')
|
|
6117
|
-
.
|
|
6118
|
-
.
|
|
6121
|
+
.text(Sao.i18n.gettext("Always ignore this warning."))
|
|
6122
|
+
.prepend(always))
|
|
6119
6123
|
);
|
|
6120
6124
|
dialog.body.append(jQuery('<p/>')
|
|
6121
6125
|
.text(Sao.i18n.gettext('Do you want to proceed?')));
|
|
@@ -7722,7 +7726,7 @@ var Sao = {};
|
|
|
7722
7726
|
return;
|
|
7723
7727
|
}
|
|
7724
7728
|
}
|
|
7725
|
-
if (this.group.prm.state() == 'pending') {
|
|
7729
|
+
if (async && this.group.prm.state() == 'pending') {
|
|
7726
7730
|
return this.group.prm.then(function() {
|
|
7727
7731
|
return this.load(name);
|
|
7728
7732
|
}.bind(this));
|
|
@@ -9103,27 +9107,16 @@ var Sao = {};
|
|
|
9103
9107
|
set: function(record, value) {
|
|
9104
9108
|
var rec_name = (
|
|
9105
9109
|
record._values[this.name + '.'] || {}).rec_name || '';
|
|
9106
|
-
var store_rec_name = function(rec_name) {
|
|
9107
|
-
Sao.setdefault(
|
|
9108
|
-
record._values, this.name + '.', {})
|
|
9109
|
-
.rec_name = rec_name[0].rec_name;
|
|
9110
|
-
};
|
|
9111
9110
|
if (!rec_name && (value >= 0) && (value !== null)) {
|
|
9112
9111
|
var model_name = record.model.fields[this.name].description
|
|
9113
9112
|
.relation;
|
|
9114
|
-
Sao.rpc({
|
|
9113
|
+
rec_name = Sao.rpc({
|
|
9115
9114
|
'method': 'model.' + model_name + '.read',
|
|
9116
9115
|
'params': [[value], ['rec_name'], record.get_context()]
|
|
9117
|
-
}, record.model.session).
|
|
9118
|
-
function() {
|
|
9119
|
-
record.group.root_group.screens.forEach(
|
|
9120
|
-
function(screen) {
|
|
9121
|
-
screen.display();
|
|
9122
|
-
});
|
|
9123
|
-
});
|
|
9124
|
-
} else {
|
|
9125
|
-
store_rec_name.call(this, [{'rec_name': rec_name}]);
|
|
9116
|
+
}, record.model.session, false)[0].rec_name;
|
|
9126
9117
|
}
|
|
9118
|
+
Sao.setdefault(
|
|
9119
|
+
record._values, this.name + '.', {}).rec_name = rec_name;
|
|
9127
9120
|
record._values[this.name] = value;
|
|
9128
9121
|
},
|
|
9129
9122
|
set_client: function(record, value, force_change) {
|
|
@@ -9674,26 +9667,21 @@ var Sao = {};
|
|
|
9674
9667
|
}
|
|
9675
9668
|
var rec_name = (
|
|
9676
9669
|
record._values[this.name + '.'] || {}).rec_name || '';
|
|
9677
|
-
var store_rec_name = function(rec_name) {
|
|
9678
|
-
Sao.setdefault(
|
|
9679
|
-
record._values, this.name + '.', {}).rec_name = rec_name;
|
|
9680
|
-
}.bind(this);
|
|
9681
9670
|
if (ref_model && ref_id !== null && ref_id >= 0) {
|
|
9682
9671
|
if (!rec_name && ref_id >= 0) {
|
|
9683
|
-
Sao.rpc({
|
|
9672
|
+
rec_name = Sao.rpc({
|
|
9684
9673
|
'method': 'model.' + ref_model + '.read',
|
|
9685
9674
|
'params': [[ref_id], ['rec_name'], record.get_context()]
|
|
9686
|
-
}, record.model.session).
|
|
9687
|
-
store_rec_name(result[0].rec_name);
|
|
9688
|
-
});
|
|
9675
|
+
}, record.model.session, false)[0].rec_name;
|
|
9689
9676
|
}
|
|
9690
9677
|
} else if (ref_model) {
|
|
9691
9678
|
rec_name = '';
|
|
9692
9679
|
} else {
|
|
9693
9680
|
rec_name = ref_id;
|
|
9694
9681
|
}
|
|
9682
|
+
Sao.setdefault(
|
|
9683
|
+
record._values, this.name + '.', {}).rec_name = rec_name;
|
|
9695
9684
|
record._values[this.name] = [ref_model, ref_id];
|
|
9696
|
-
store_rec_name(rec_name);
|
|
9697
9685
|
},
|
|
9698
9686
|
get_on_change_value: function(record) {
|
|
9699
9687
|
if ((record.group.parent_name == this.name) &&
|
|
@@ -10161,10 +10149,16 @@ var Sao = {};
|
|
|
10161
10149
|
this.buttons[item.id].click(item, function(event) {
|
|
10162
10150
|
var item = event.data;
|
|
10163
10151
|
var button = this.buttons[item.id];
|
|
10164
|
-
|
|
10152
|
+
// Use data instead of disabled prop because the action may
|
|
10153
|
+
// actually disable the button.
|
|
10154
|
+
if (button.data('disabled')) {
|
|
10155
|
+
event.preventDefault();
|
|
10156
|
+
return;
|
|
10157
|
+
}
|
|
10158
|
+
button.data('disabled', true);
|
|
10165
10159
|
(this[item.id](this) || jQuery.when())
|
|
10166
10160
|
.always(function() {
|
|
10167
|
-
button.
|
|
10161
|
+
button.data('disabled', false);
|
|
10168
10162
|
});
|
|
10169
10163
|
}.bind(this));
|
|
10170
10164
|
};
|
|
@@ -10607,13 +10601,14 @@ var Sao = {};
|
|
|
10607
10601
|
menu.children().length);
|
|
10608
10602
|
}
|
|
10609
10603
|
|
|
10610
|
-
if (menu_action[0] == 'print')
|
|
10611
|
-
|
|
10604
|
+
if ((menu_action[0] == 'print') &&
|
|
10605
|
+
toolbars.exports.length) {
|
|
10606
|
+
button._can_be_sensitive = true;
|
|
10607
|
+
if (toolbars.print.length) {
|
|
10612
10608
|
menu.append(jQuery('<li/>', {
|
|
10613
10609
|
'role': 'separator',
|
|
10614
10610
|
'class': 'divider',
|
|
10615
10611
|
}));
|
|
10616
|
-
button._can_be_sensitive = true;
|
|
10617
10612
|
}
|
|
10618
10613
|
toolbars.exports.forEach(function(export_) {
|
|
10619
10614
|
var item = jQuery('<li/>', {
|
|
@@ -12285,11 +12280,11 @@ var Sao = {};
|
|
|
12285
12280
|
var value = this._parse(this.format, date.val());
|
|
12286
12281
|
value = this._format(this.format, value);
|
|
12287
12282
|
date.val(value);
|
|
12288
|
-
});
|
|
12283
|
+
}.bind(this));
|
|
12289
12284
|
mousetrap.bind('=', function(e, combo) {
|
|
12290
12285
|
e.preventDefault();
|
|
12291
12286
|
date.val(this._format(this.format, moment()));
|
|
12292
|
-
});
|
|
12287
|
+
}.bind(this));
|
|
12293
12288
|
|
|
12294
12289
|
Sao.common.DATE_OPERATORS.forEach(function(operator) {
|
|
12295
12290
|
mousetrap.bind(operator[0], function(e, combo) {
|
|
@@ -13567,6 +13562,7 @@ var Sao = {};
|
|
|
13567
13562
|
return record.model.execute(attributes.name, [values],
|
|
13568
13563
|
this.context).then(function(changes) {
|
|
13569
13564
|
record.set_on_change(changes);
|
|
13565
|
+
record.group.changed();
|
|
13570
13566
|
record.group.root_group.screens.forEach(
|
|
13571
13567
|
function(screen) {
|
|
13572
13568
|
screen.display();
|
|
@@ -14907,6 +14903,7 @@ function eval_pyson(value){
|
|
|
14907
14903
|
this.el = jQuery('<button/>', {
|
|
14908
14904
|
'class': this.class_ + ' btn btn-link',
|
|
14909
14905
|
'name': attributes.name,
|
|
14906
|
+
'type': 'button',
|
|
14910
14907
|
});
|
|
14911
14908
|
if (attributes.icon) {
|
|
14912
14909
|
var img = jQuery('<img/>', {
|
|
@@ -21135,9 +21132,13 @@ function eval_pyson(value){
|
|
|
21135
21132
|
}.bind(this));
|
|
21136
21133
|
}
|
|
21137
21134
|
} else {
|
|
21138
|
-
|
|
21139
|
-
.
|
|
21140
|
-
|
|
21135
|
+
prm.then(function() {
|
|
21136
|
+
this._get_column_td(
|
|
21137
|
+
next_column, next_row)
|
|
21138
|
+
.trigger('click')
|
|
21139
|
+
.find(':input,[tabindex=0]')
|
|
21140
|
+
.focus();
|
|
21141
|
+
}.bind(this));
|
|
21141
21142
|
}
|
|
21142
21143
|
}
|
|
21143
21144
|
}.bind(this));
|