tryton-sao 6.2.8 → 6.2.9
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 +3 -0
- package/dist/tryton-sao.js +33 -35
- package/dist/tryton-sao.min.js +2 -2
- package/package.json +1 -1
- package/src/common.js +15 -17
- package/src/model.js +4 -4
- package/src/view/form.js +3 -3
- package/src/view/list_form.js +1 -1
- package/src/view/tree.js +6 -6
- package/src/window.js +4 -4
- package/tests/sao.js +2 -0
package/CHANGELOG
CHANGED
package/dist/tryton-sao.js
CHANGED
|
@@ -4246,7 +4246,7 @@ var Sao = {};
|
|
|
4246
4246
|
|
|
4247
4247
|
var pslice = function(string, depth) {
|
|
4248
4248
|
if (depth > 0) {
|
|
4249
|
-
return string.substring(0, depth);
|
|
4249
|
+
return string.substring(0, string.length - depth);
|
|
4250
4250
|
}
|
|
4251
4251
|
return string;
|
|
4252
4252
|
};
|
|
@@ -4356,8 +4356,8 @@ var Sao = {};
|
|
|
4356
4356
|
}
|
|
4357
4357
|
return results;
|
|
4358
4358
|
},
|
|
4359
|
-
|
|
4360
|
-
return (
|
|
4359
|
+
is_subdomain: function(element) {
|
|
4360
|
+
return (element instanceof Array) && !element.clause;
|
|
4361
4361
|
},
|
|
4362
4362
|
ending_clause: function(domain, depth) {
|
|
4363
4363
|
if (depth === undefined) {
|
|
@@ -4367,7 +4367,7 @@ var Sao = {};
|
|
|
4367
4367
|
return [null, depth];
|
|
4368
4368
|
}
|
|
4369
4369
|
var last_element = domain[domain.length - 1];
|
|
4370
|
-
if (
|
|
4370
|
+
if (this.is_subdomain(last_element)) {
|
|
4371
4371
|
return this.ending_clause(last_element, depth + 1);
|
|
4372
4372
|
}
|
|
4373
4373
|
return [last_element, depth];
|
|
@@ -4378,9 +4378,9 @@ var Sao = {};
|
|
|
4378
4378
|
for (i = 0, len=domain.length - 1; i < len; i++) {
|
|
4379
4379
|
results.push(domain[i]);
|
|
4380
4380
|
}
|
|
4381
|
-
if (
|
|
4382
|
-
results
|
|
4383
|
-
|
|
4381
|
+
if (this.is_subdomain(domain[i])) {
|
|
4382
|
+
results.push(
|
|
4383
|
+
this.replace_ending_clause(domain[i], clause));
|
|
4384
4384
|
} else {
|
|
4385
4385
|
results.push(clause);
|
|
4386
4386
|
}
|
|
@@ -4392,7 +4392,7 @@ var Sao = {};
|
|
|
4392
4392
|
}
|
|
4393
4393
|
var results = domain.slice(0, -1);
|
|
4394
4394
|
var last_element = domain[domain.length - 1];
|
|
4395
|
-
if (
|
|
4395
|
+
if (this.is_subdomain(last_element)) {
|
|
4396
4396
|
results.push(this.append_ending_clause(last_element, clause,
|
|
4397
4397
|
depth - 1));
|
|
4398
4398
|
} else {
|
|
@@ -5133,19 +5133,17 @@ var Sao = {};
|
|
|
5133
5133
|
}
|
|
5134
5134
|
},
|
|
5135
5135
|
simplify: function(value) {
|
|
5136
|
-
if (
|
|
5137
|
-
if ((value.length == 1) && (value[0]
|
|
5138
|
-
((value[0][0] == 'AND') || (value[0][0] == 'OR') ||
|
|
5139
|
-
(value[0][0] instanceof Array))) {
|
|
5136
|
+
if (this.is_subdomain(value)) {
|
|
5137
|
+
if ((value.length == 1) && this.is_subdomain(value[0])) {
|
|
5140
5138
|
return this.simplify(value[0]);
|
|
5141
5139
|
} else if ((value.length == 2) &&
|
|
5142
|
-
|
|
5143
|
-
|
|
5140
|
+
((value[0] == 'AND') || (value[0] == 'OR')) &&
|
|
5141
|
+
this.is_subdomain(value[1])) {
|
|
5144
5142
|
return this.simplify(value[1]);
|
|
5145
5143
|
} else if ((value.length == 3) &&
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5144
|
+
((value[0] == 'AND') || (value[0] == 'OR')) &&
|
|
5145
|
+
this.is_subdomain(value[1]) &&
|
|
5146
|
+
(value[0] == value[1][0])) {
|
|
5149
5147
|
value = this.simplify(value[1]).concat([value[2]]);
|
|
5150
5148
|
}
|
|
5151
5149
|
return value.map(this.simplify.bind(this));
|
|
@@ -9446,7 +9444,7 @@ var Sao = {};
|
|
|
9446
9444
|
if (value instanceof Array) {
|
|
9447
9445
|
return this._set_value(record, value, false, true);
|
|
9448
9446
|
}
|
|
9449
|
-
if (value.add || value.update) {
|
|
9447
|
+
if (value && (value.add || value.update)) {
|
|
9450
9448
|
var context = this.get_context(record);
|
|
9451
9449
|
fields = record._values[this.name].model.fields;
|
|
9452
9450
|
var new_field_names = {};
|
|
@@ -9486,7 +9484,7 @@ var Sao = {};
|
|
|
9486
9484
|
}
|
|
9487
9485
|
|
|
9488
9486
|
var group = record._values[this.name];
|
|
9489
|
-
if (value.delete) {
|
|
9487
|
+
if (value && value.delete) {
|
|
9490
9488
|
value.delete.forEach(function(record_id) {
|
|
9491
9489
|
var record2 = group.get(record_id);
|
|
9492
9490
|
if (record2) {
|
|
@@ -9494,7 +9492,7 @@ var Sao = {};
|
|
|
9494
9492
|
}
|
|
9495
9493
|
}.bind(this));
|
|
9496
9494
|
}
|
|
9497
|
-
if (value.remove) {
|
|
9495
|
+
if (value && value.remove) {
|
|
9498
9496
|
value.remove.forEach(function(record_id) {
|
|
9499
9497
|
var record2 = group.get(record_id);
|
|
9500
9498
|
if (record2) {
|
|
@@ -9503,7 +9501,7 @@ var Sao = {};
|
|
|
9503
9501
|
}.bind(this));
|
|
9504
9502
|
}
|
|
9505
9503
|
|
|
9506
|
-
if (value.add || value.update) {
|
|
9504
|
+
if (value && (value.add || value.update)) {
|
|
9507
9505
|
// First set already added fields to prevent triggering a
|
|
9508
9506
|
// second on_change call
|
|
9509
9507
|
if (value.update) {
|
|
@@ -16691,7 +16689,7 @@ function eval_pyson(value){
|
|
|
16691
16689
|
if (this.has_target(value)) {
|
|
16692
16690
|
var m2o_id =
|
|
16693
16691
|
this.id_from_value(record.field_get(this.field_name));
|
|
16694
|
-
if (evt && evt.ctrlKey) {
|
|
16692
|
+
if (evt && (evt.ctrlKey || evt.metaKey)) {
|
|
16695
16693
|
var params = {};
|
|
16696
16694
|
params.model = this.get_model();
|
|
16697
16695
|
params.res_id = m2o_id;
|
|
@@ -18362,8 +18360,8 @@ function eval_pyson(value){
|
|
|
18362
18360
|
},
|
|
18363
18361
|
set_readonly: function(readonly) {
|
|
18364
18362
|
Sao.View.Form.Image._super.set_readonly.call(this, readonly);
|
|
18365
|
-
this.but_select.prop('
|
|
18366
|
-
this.but_clear.prop('
|
|
18363
|
+
this.but_select.prop('disabled', readonly);
|
|
18364
|
+
this.but_clear.prop('disabled', readonly);
|
|
18367
18365
|
},
|
|
18368
18366
|
clear: function() {
|
|
18369
18367
|
Sao.View.Form.Image._super.clear.call(this);
|
|
@@ -19878,7 +19876,7 @@ function eval_pyson(value){
|
|
|
19878
19876
|
|
|
19879
19877
|
var parent_row = null;
|
|
19880
19878
|
var dest_position;
|
|
19881
|
-
if (evt.ctrlKey && this.children_field) {
|
|
19879
|
+
if ((evt.ctrlKey || evt.metaKey) && this.children_field) {
|
|
19882
19880
|
parent_row = this._find_row(row.el.prev());
|
|
19883
19881
|
dest_position = (parent_row || this).rows.length;
|
|
19884
19882
|
} else {
|
|
@@ -20195,8 +20193,6 @@ function eval_pyson(value){
|
|
|
20195
20193
|
}
|
|
20196
20194
|
this.table.css('min-width', 'calc(' + min_width.join(' + ') + ')');
|
|
20197
20195
|
this.scrollbar.css('min-width', this.table.css('min-width'));
|
|
20198
|
-
this.tbody.find('tr.more-row > td').attr(
|
|
20199
|
-
'colspan', visible_columns);
|
|
20200
20196
|
|
|
20201
20197
|
if (!this.table.hasClass('no-responsive') &
|
|
20202
20198
|
(this.columns.filter(function(c) {
|
|
@@ -20226,7 +20222,9 @@ function eval_pyson(value){
|
|
|
20226
20222
|
var more_row = jQuery('<tr/>', {
|
|
20227
20223
|
'class': 'more-row',
|
|
20228
20224
|
});
|
|
20229
|
-
var more_cell = jQuery('<td/>'
|
|
20225
|
+
var more_cell = jQuery('<td/>', {
|
|
20226
|
+
'colspan': visible_columns,
|
|
20227
|
+
});
|
|
20230
20228
|
var more_button = jQuery('<button/>', {
|
|
20231
20229
|
'class': 'btn btn-default btn-block',
|
|
20232
20230
|
'type': 'button',
|
|
@@ -21093,7 +21091,7 @@ function eval_pyson(value){
|
|
|
21093
21091
|
current_record = this.tree.screen.current_record;
|
|
21094
21092
|
this.tree.select_records(current_record, this.record);
|
|
21095
21093
|
} else {
|
|
21096
|
-
if (!event_.ctrlKey ||
|
|
21094
|
+
if (!(event_.ctrlKey || event_.metaKey) ||
|
|
21097
21095
|
this.tree.selection_mode ==
|
|
21098
21096
|
Sao.common.SELECTION_SINGLE) {
|
|
21099
21097
|
this.tree.select_records(null, null);
|
|
@@ -21287,7 +21285,7 @@ function eval_pyson(value){
|
|
|
21287
21285
|
|
|
21288
21286
|
Sao.View.Tree.RowEditable._super.select_row.call(this, event_);
|
|
21289
21287
|
|
|
21290
|
-
if (!event_.shiftKey && !event_.ctrlKey) {
|
|
21288
|
+
if (!event_.shiftKey && !(event_.ctrlKey || event_.metaKey)) {
|
|
21291
21289
|
this.tree.edit_row(this);
|
|
21292
21290
|
}
|
|
21293
21291
|
},
|
|
@@ -23191,7 +23189,7 @@ function eval_pyson(value){
|
|
|
23191
23189
|
}
|
|
23192
23190
|
this.select_records(i, view_form_idx);
|
|
23193
23191
|
} else {
|
|
23194
|
-
if (!event_.ctrlKey) {
|
|
23192
|
+
if (!(event_.ctrlKey || event_.metaKey)) {
|
|
23195
23193
|
this.select_records(null, null);
|
|
23196
23194
|
}
|
|
23197
23195
|
this.record = view_form.record;
|
|
@@ -24734,7 +24732,7 @@ function eval_pyson(value){
|
|
|
24734
24732
|
}).text(el_field.attr('name')).prepend(
|
|
24735
24733
|
Sao.common.ICONFACTORY.get_icon_img('tryton-drag')
|
|
24736
24734
|
).click(function(e) {
|
|
24737
|
-
if (e.ctrlKey) {
|
|
24735
|
+
if (e.ctrlKey || e.metaKey) {
|
|
24738
24736
|
node.toggleClass('bg-primary');
|
|
24739
24737
|
} else {
|
|
24740
24738
|
jQuery(e.target).addClass('bg-primary')
|
|
@@ -24758,7 +24756,7 @@ function eval_pyson(value){
|
|
|
24758
24756
|
'field': parent_node[field].field,
|
|
24759
24757
|
'name': parent_node[field].name
|
|
24760
24758
|
}).text(name).click(function(e) {
|
|
24761
|
-
if(e.ctrlKey) {
|
|
24759
|
+
if (e.ctrlKey || e.metaKey) {
|
|
24762
24760
|
node.toggleClass('bg-primary');
|
|
24763
24761
|
} else {
|
|
24764
24762
|
this.fields_all.find('li').removeClass('bg-primary');
|
|
@@ -25117,7 +25115,7 @@ function eval_pyson(value){
|
|
|
25117
25115
|
var node = jQuery('<li/>', {
|
|
25118
25116
|
'path': path
|
|
25119
25117
|
}).text(parent_node[name].string).click(function(e) {
|
|
25120
|
-
if(e.ctrlKey) {
|
|
25118
|
+
if (e.ctrlKey || e.metaKey) {
|
|
25121
25119
|
node.toggleClass('bg-primary');
|
|
25122
25120
|
} else {
|
|
25123
25121
|
this.fields_all.find('li')
|
|
@@ -25366,7 +25364,7 @@ function eval_pyson(value){
|
|
|
25366
25364
|
'path': name,
|
|
25367
25365
|
'class': 'draggable-handle',
|
|
25368
25366
|
}).text(long_string).click(function(e) {
|
|
25369
|
-
if(e.ctrlKey) {
|
|
25367
|
+
if (e.ctrlKey || e.metaKey) {
|
|
25370
25368
|
node.toggleClass('bg-primary');
|
|
25371
25369
|
} else {
|
|
25372
25370
|
jQuery(e.target).addClass('bg-primary')
|