tryton-sao 6.0.12 → 6.0.15
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/COPYRIGHT +1 -1
- package/dist/tryton-sao.js +49 -44
- package/dist/tryton-sao.min.js +2 -2
- package/package.json +1 -1
- package/src/model.js +8 -24
- package/src/pyson.js +1 -1
- package/src/screen.js +1 -0
- package/src/view/form.js +1 -0
- package/src/view/tree.js +38 -19
- package/tests/sao.js +14 -0
package/CHANGELOG
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
Version 6.0.15 - 2022-03-01
|
|
2
|
+
* Bug fixes (see mercurial logs for details)
|
|
3
|
+
|
|
4
|
+
Version 6.0.14 - 2022-02-16
|
|
5
|
+
* Bug fixes (see mercurial logs for details)
|
|
6
|
+
|
|
7
|
+
Version 6.0.13 - 2022-02-01
|
|
8
|
+
* Bug fixes (see mercurial logs for details)
|
|
9
|
+
|
|
1
10
|
Version 6.0.12 - 2022-01-15
|
|
2
11
|
* Bug fixes (see mercurial logs for details)
|
|
3
12
|
|
package/COPYRIGHT
CHANGED
package/dist/tryton-sao.js
CHANGED
|
@@ -1685,7 +1685,7 @@ var Sao = {};
|
|
|
1685
1685
|
|
|
1686
1686
|
Sao.PYSON.Eval.eval_ = function(value, context) {
|
|
1687
1687
|
var idx = value.v.indexOf('.');
|
|
1688
|
-
if (idx >= 0) {
|
|
1688
|
+
if ((idx >= 0) && !(value.v in context)) {
|
|
1689
1689
|
return Sao.PYSON.Eval.eval_({
|
|
1690
1690
|
'v': value.v.substring(idx + 1),
|
|
1691
1691
|
'd': value.d,
|
|
@@ -9103,27 +9103,16 @@ var Sao = {};
|
|
|
9103
9103
|
set: function(record, value) {
|
|
9104
9104
|
var rec_name = (
|
|
9105
9105
|
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
9106
|
if (!rec_name && (value >= 0) && (value !== null)) {
|
|
9112
9107
|
var model_name = record.model.fields[this.name].description
|
|
9113
9108
|
.relation;
|
|
9114
|
-
Sao.rpc({
|
|
9109
|
+
rec_name = Sao.rpc({
|
|
9115
9110
|
'method': 'model.' + model_name + '.read',
|
|
9116
9111
|
'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}]);
|
|
9112
|
+
}, record.model.session, false)[0].rec_name;
|
|
9126
9113
|
}
|
|
9114
|
+
Sao.setdefault(
|
|
9115
|
+
record._values, this.name + '.', {}).rec_name = rec_name;
|
|
9127
9116
|
record._values[this.name] = value;
|
|
9128
9117
|
},
|
|
9129
9118
|
set_client: function(record, value, force_change) {
|
|
@@ -9674,26 +9663,21 @@ var Sao = {};
|
|
|
9674
9663
|
}
|
|
9675
9664
|
var rec_name = (
|
|
9676
9665
|
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
9666
|
if (ref_model && ref_id !== null && ref_id >= 0) {
|
|
9682
9667
|
if (!rec_name && ref_id >= 0) {
|
|
9683
|
-
Sao.rpc({
|
|
9668
|
+
rec_name = Sao.rpc({
|
|
9684
9669
|
'method': 'model.' + ref_model + '.read',
|
|
9685
9670
|
'params': [[ref_id], ['rec_name'], record.get_context()]
|
|
9686
|
-
}, record.model.session).
|
|
9687
|
-
store_rec_name(result[0].rec_name);
|
|
9688
|
-
});
|
|
9671
|
+
}, record.model.session, false)[0].rec_name;
|
|
9689
9672
|
}
|
|
9690
9673
|
} else if (ref_model) {
|
|
9691
9674
|
rec_name = '';
|
|
9692
9675
|
} else {
|
|
9693
9676
|
rec_name = ref_id;
|
|
9694
9677
|
}
|
|
9678
|
+
Sao.setdefault(
|
|
9679
|
+
record._values, this.name + '.', {}).rec_name = rec_name;
|
|
9695
9680
|
record._values[this.name] = [ref_model, ref_id];
|
|
9696
|
-
store_rec_name(rec_name);
|
|
9697
9681
|
},
|
|
9698
9682
|
get_on_change_value: function(record) {
|
|
9699
9683
|
if ((record.group.parent_name == this.name) &&
|
|
@@ -13567,6 +13551,7 @@ var Sao = {};
|
|
|
13567
13551
|
return record.model.execute(attributes.name, [values],
|
|
13568
13552
|
this.context).then(function(changes) {
|
|
13569
13553
|
record.set_on_change(changes);
|
|
13554
|
+
record.group.changed();
|
|
13570
13555
|
record.group.root_group.screens.forEach(
|
|
13571
13556
|
function(screen) {
|
|
13572
13557
|
screen.display();
|
|
@@ -14907,6 +14892,7 @@ function eval_pyson(value){
|
|
|
14907
14892
|
this.el = jQuery('<button/>', {
|
|
14908
14893
|
'class': this.class_ + ' btn btn-link',
|
|
14909
14894
|
'name': attributes.name,
|
|
14895
|
+
'type': 'button',
|
|
14910
14896
|
});
|
|
14911
14897
|
if (attributes.icon) {
|
|
14912
14898
|
var img = jQuery('<img/>', {
|
|
@@ -19868,8 +19854,8 @@ function eval_pyson(value){
|
|
|
19868
19854
|
!column.col.hasClass('selection-state') &&
|
|
19869
19855
|
!column.col.hasClass('favorite')) {
|
|
19870
19856
|
var width, c_width;
|
|
19871
|
-
if (column.width) {
|
|
19872
|
-
width = c_width = column.width;
|
|
19857
|
+
if (column.attributes.width) {
|
|
19858
|
+
width = c_width = column.attributes.width;
|
|
19873
19859
|
min_width.push(width + 'px');
|
|
19874
19860
|
} else {
|
|
19875
19861
|
width = {
|
|
@@ -20486,6 +20472,18 @@ function eval_pyson(value){
|
|
|
20486
20472
|
this.select_column(event_.data.index);
|
|
20487
20473
|
}.bind(this);
|
|
20488
20474
|
|
|
20475
|
+
if (this.children_field) {
|
|
20476
|
+
this.expander = jQuery('<span/>', {
|
|
20477
|
+
'class': 'expander',
|
|
20478
|
+
}).append('<img/>', {
|
|
20479
|
+
'tabindex': 0,
|
|
20480
|
+
'class': 'icon',
|
|
20481
|
+
});
|
|
20482
|
+
this.expander.children().html(' ');
|
|
20483
|
+
this.expander.on('click keypress',
|
|
20484
|
+
Sao.common.click_press(this.toggle_row.bind(this)));
|
|
20485
|
+
}
|
|
20486
|
+
|
|
20489
20487
|
for (var i = 0; i < this.tree.columns.length; i++) {
|
|
20490
20488
|
var column = this.tree.columns[i];
|
|
20491
20489
|
if (column instanceof Sao.View.Tree.ButtonColumn) {
|
|
@@ -20513,18 +20511,6 @@ function eval_pyson(value){
|
|
|
20513
20511
|
'class': 'cell',
|
|
20514
20512
|
});
|
|
20515
20513
|
td.append(cell);
|
|
20516
|
-
if ((i === 0) && this.children_field) {
|
|
20517
|
-
this.expander = jQuery('<img/>', {
|
|
20518
|
-
'tabindex': 0,
|
|
20519
|
-
'class': 'icon',
|
|
20520
|
-
});
|
|
20521
|
-
this.expander.html(' ');
|
|
20522
|
-
this.expander.on('click keypress',
|
|
20523
|
-
Sao.common.click_press(this.toggle_row.bind(this)));
|
|
20524
|
-
cell.append(jQuery('<span/>', {
|
|
20525
|
-
'class': 'expander'
|
|
20526
|
-
}).append(this.expander));
|
|
20527
|
-
}
|
|
20528
20514
|
var j;
|
|
20529
20515
|
if (column.prefixes) {
|
|
20530
20516
|
for (j = 0; j < column.prefixes.length; j++) {
|
|
@@ -20637,6 +20623,21 @@ function eval_pyson(value){
|
|
|
20637
20623
|
}
|
|
20638
20624
|
}
|
|
20639
20625
|
}
|
|
20626
|
+
if (this.children_field) {
|
|
20627
|
+
this.tree.columns.every(function(column, i) {
|
|
20628
|
+
if (column.col.hasClass('draggable-handle') ||
|
|
20629
|
+
column.header.hasClass('invisible')) {
|
|
20630
|
+
return true;
|
|
20631
|
+
} else {
|
|
20632
|
+
var td = this._get_column_td(i);
|
|
20633
|
+
var cell = td.find('.cell');
|
|
20634
|
+
if (this.expander.parent()[0] !== cell[0]) {
|
|
20635
|
+
cell.prepend(this.expander);
|
|
20636
|
+
}
|
|
20637
|
+
return false;
|
|
20638
|
+
}
|
|
20639
|
+
}.bind(this));
|
|
20640
|
+
}
|
|
20640
20641
|
this._drawed_record = this.record.identity;
|
|
20641
20642
|
|
|
20642
20643
|
var row_id_path = this.get_id_path();
|
|
@@ -20647,7 +20648,7 @@ function eval_pyson(value){
|
|
|
20647
20648
|
if (Sao.i18n.rtl) {
|
|
20648
20649
|
margin = 'margin-right';
|
|
20649
20650
|
}
|
|
20650
|
-
this.expander.css(margin, (depth - 1) + 'em');
|
|
20651
|
+
this.expander.children().css(margin, (depth - 1) + 'em');
|
|
20651
20652
|
|
|
20652
20653
|
var update_expander = function() {
|
|
20653
20654
|
var length = this.record.field_get_client(
|
|
@@ -20705,7 +20706,7 @@ function eval_pyson(value){
|
|
|
20705
20706
|
}
|
|
20706
20707
|
Sao.common.ICONFACTORY.get_icon_url(icon)
|
|
20707
20708
|
.then(function(url) {
|
|
20708
|
-
this.expander.attr('src', url);
|
|
20709
|
+
this.expander.children().attr('src', url);
|
|
20709
20710
|
}.bind(this));
|
|
20710
20711
|
},
|
|
20711
20712
|
collapse_children: function() {
|
|
@@ -21120,9 +21121,13 @@ function eval_pyson(value){
|
|
|
21120
21121
|
}.bind(this));
|
|
21121
21122
|
}
|
|
21122
21123
|
} else {
|
|
21123
|
-
|
|
21124
|
-
.
|
|
21125
|
-
|
|
21124
|
+
prm.then(function() {
|
|
21125
|
+
this._get_column_td(
|
|
21126
|
+
next_column, next_row)
|
|
21127
|
+
.trigger('click')
|
|
21128
|
+
.find(':input,[tabindex=0]')
|
|
21129
|
+
.focus();
|
|
21130
|
+
}.bind(this));
|
|
21126
21131
|
}
|
|
21127
21132
|
}
|
|
21128
21133
|
}.bind(this));
|