tryton-sao 6.8.11 → 6.8.13
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/Gruntfile.js +4 -22
- package/dist/tryton-sao.css +1 -1
- package/dist/tryton-sao.js +38 -47
- package/dist/tryton-sao.min.css +1 -1
- package/dist/tryton-sao.min.js +2 -2
- package/package.json +4 -2
- package/src/common.js +10 -20
- package/src/pyson.js +2 -2
- package/src/sao.js +7 -4
- package/src/sao.less +1 -1
- package/src/view/form.js +1 -3
- package/src/view/graph.js +1 -1
- package/src/view/list_form.js +4 -2
- package/src/view/tree.js +1 -1
- package/src/window.js +12 -14
- package/tests/sao.js +19 -1
- package/src/.jshintrc +0 -6
- package/tests/.jshintrc +0 -8
package/CHANGELOG
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
|
|
2
|
+
Version 6.8.13 - 2024-04-17
|
|
3
|
+
---------------------------
|
|
4
|
+
* Bug fixes (see mercurial logs for details)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Version 6.8.12 - 2024-04-04
|
|
8
|
+
---------------------------
|
|
9
|
+
* Bug fixes (see mercurial logs for details)
|
|
10
|
+
|
|
11
|
+
|
|
2
12
|
Version 6.8.11 - 2024-03-03
|
|
3
13
|
---------------------------
|
|
4
14
|
* Bug fixes (see mercurial logs for details)
|
package/Gruntfile.js
CHANGED
|
@@ -75,23 +75,6 @@ module.exports = function(grunt) {
|
|
|
75
75
|
dest: 'dist/<%= pkg.name %>.js'
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
jshint: {
|
|
79
|
-
dist: {
|
|
80
|
-
options: {
|
|
81
|
-
jshintrc: 'src/.jshintrc'
|
|
82
|
-
},
|
|
83
|
-
src: ['dist/<%= pkg.name %>.js']
|
|
84
|
-
},
|
|
85
|
-
grunt: {
|
|
86
|
-
src: ['Gruntfile.js']
|
|
87
|
-
},
|
|
88
|
-
tests: {
|
|
89
|
-
options: {
|
|
90
|
-
jshintrc: 'tests/.jshintrc'
|
|
91
|
-
},
|
|
92
|
-
src: ['tests/*.js']
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
78
|
uglify: {
|
|
96
79
|
options: {
|
|
97
80
|
banner: '/*! <%= pkg.name %>-<%= pkg.version %> | GPL-3\n' +
|
|
@@ -127,7 +110,7 @@ module.exports = function(grunt) {
|
|
|
127
110
|
watch: {
|
|
128
111
|
scripts: {
|
|
129
112
|
files: ['src/**/*.js'],
|
|
130
|
-
tasks: ['concat'
|
|
113
|
+
tasks: ['concat']
|
|
131
114
|
},
|
|
132
115
|
styles: {
|
|
133
116
|
files: ['src/*.less'],
|
|
@@ -152,17 +135,16 @@ module.exports = function(grunt) {
|
|
|
152
135
|
});
|
|
153
136
|
|
|
154
137
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
|
155
|
-
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
156
138
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
157
139
|
grunt.loadNpmTasks('grunt-contrib-less');
|
|
158
140
|
grunt.loadNpmTasks('grunt-po2json');
|
|
159
141
|
grunt.loadNpmTasks('grunt-qunit-junit');
|
|
160
142
|
|
|
161
143
|
grunt.registerTask('default', 'Build for production.', function() {
|
|
162
|
-
grunt.task.run(['concat', '
|
|
144
|
+
grunt.task.run(['concat', 'uglify', 'less', 'po2json']);
|
|
163
145
|
});
|
|
164
146
|
grunt.registerTask('dev', 'Build for development.', function() {
|
|
165
|
-
grunt.task.run(['concat', '
|
|
147
|
+
grunt.task.run(['concat', 'less:dev']);
|
|
166
148
|
});
|
|
167
149
|
grunt.registerTask('devwatch', 'Watch development', function() {
|
|
168
150
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
@@ -178,7 +160,7 @@ module.exports = function(grunt) {
|
|
|
178
160
|
});
|
|
179
161
|
grunt.registerTask('test', 'Run tests', function() {
|
|
180
162
|
grunt.loadNpmTasks('grunt-contrib-qunit');
|
|
181
|
-
grunt.task.run(['concat', '
|
|
163
|
+
grunt.task.run(['concat', 'less:dev', 'qunit_junit', 'qunit']);
|
|
182
164
|
});
|
|
183
165
|
|
|
184
166
|
};
|
package/dist/tryton-sao.css
CHANGED
|
@@ -9955,8 +9955,8 @@ img.icon {
|
|
|
9955
9955
|
.form .form-richtext > textarea,
|
|
9956
9956
|
.form .form-text .richtext,
|
|
9957
9957
|
.form .form-richtext .richtext {
|
|
9958
|
+
height: 100%;
|
|
9958
9959
|
line-height: 2.5ex;
|
|
9959
|
-
max-height: 50ex;
|
|
9960
9960
|
min-height: 12.5ex;
|
|
9961
9961
|
overflow: auto;
|
|
9962
9962
|
resize: vertical;
|
package/dist/tryton-sao.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/* This file is part of Tryton. The COPYRIGHT file at the top level of
|
|
2
2
|
this repository contains the full copyright notices and license terms. */
|
|
3
|
+
|
|
4
|
+
/* eslint-disable no-redeclare */
|
|
3
5
|
var Sao = {
|
|
4
|
-
__version__: '6.8.
|
|
6
|
+
__version__: '6.8.13',
|
|
5
7
|
};
|
|
8
|
+
/* eslint-enable no-redeclare */
|
|
6
9
|
|
|
7
10
|
(function() {
|
|
8
11
|
'use strict';
|
|
@@ -342,7 +345,7 @@ var Sao = {
|
|
|
342
345
|
} else {
|
|
343
346
|
doc_version = doc_version.join('.');
|
|
344
347
|
}
|
|
345
|
-
Sao.config.doc_url = `https://docs.tryton.org
|
|
348
|
+
Sao.config.doc_url = `https://docs.tryton.org/${doc_version}`;
|
|
346
349
|
Sao.config.bug_url = 'https://bugs.tryton.org/';
|
|
347
350
|
Sao.config.title = 'Tryton';
|
|
348
351
|
Sao.config.icon_colors = '#267f82,#3e4950,#e78e42'.split(',');
|
|
@@ -1201,7 +1204,7 @@ var Sao = {
|
|
|
1201
1204
|
if (definition.id){
|
|
1202
1205
|
var current_tab = Sao.Tab.tabs.get_current();
|
|
1203
1206
|
if (current_tab) {
|
|
1204
|
-
var focused =
|
|
1207
|
+
var focused = jQuery(':focus');
|
|
1205
1208
|
focused.blur();
|
|
1206
1209
|
current_tab.el.find('a[id="' + definition.id + '"]').click();
|
|
1207
1210
|
focused.focus();
|
|
@@ -1283,7 +1286,7 @@ var Sao = {
|
|
|
1283
1286
|
.on('hidden.bs.modal', '.modal', function(event) {
|
|
1284
1287
|
setModalsAndBackdropsOrder();
|
|
1285
1288
|
if (jQuery('.modal:visible').length) {
|
|
1286
|
-
|
|
1289
|
+
jQuery(document.body).addClass('modal-open');
|
|
1287
1290
|
}
|
|
1288
1291
|
});
|
|
1289
1292
|
|
|
@@ -1811,7 +1814,7 @@ var Sao = {
|
|
|
1811
1814
|
value = new Sao.PYSON.Bool(value);
|
|
1812
1815
|
}
|
|
1813
1816
|
} else if (typeof value != 'boolean') {
|
|
1814
|
-
value = Sao.PYSON.Bool(value);
|
|
1817
|
+
value = new Sao.PYSON.Bool(value);
|
|
1815
1818
|
}
|
|
1816
1819
|
this._value = value;
|
|
1817
1820
|
},
|
|
@@ -1830,7 +1833,7 @@ var Sao = {
|
|
|
1830
1833
|
});
|
|
1831
1834
|
|
|
1832
1835
|
Sao.PYSON.Not.eval_ = function(value, context) {
|
|
1833
|
-
return !value
|
|
1836
|
+
return !Sao.PYSON.Bool.eval_(value, context);
|
|
1834
1837
|
};
|
|
1835
1838
|
Sao.PYSON.Not.init_from_object = function(obj) {
|
|
1836
1839
|
return new Sao.PYSON.Not(obj.v);
|
|
@@ -3415,21 +3418,14 @@ var Sao = {
|
|
|
3415
3418
|
};
|
|
3416
3419
|
|
|
3417
3420
|
Sao.common.parse_time = function(format, value) {
|
|
3418
|
-
|
|
3419
|
-
|
|
3421
|
+
var date = moment(value, Sao.common.moment_format(format));
|
|
3422
|
+
if (date.isValid()) {
|
|
3423
|
+
date = Sao.Time(
|
|
3424
|
+
date.hour(), date.minute(), date.second(), date.millisecond());
|
|
3425
|
+
} else {
|
|
3426
|
+
date = null;
|
|
3420
3427
|
}
|
|
3421
|
-
|
|
3422
|
-
var i = format.indexOf(pattern);
|
|
3423
|
-
if (~i) {
|
|
3424
|
-
var number = parseInt(value.slice(i, i + pattern.length), 10);
|
|
3425
|
-
if (!isNaN(number)) {
|
|
3426
|
-
return number;
|
|
3427
|
-
}
|
|
3428
|
-
}
|
|
3429
|
-
return 0;
|
|
3430
|
-
};
|
|
3431
|
-
return Sao.Time(getNumber('%H'), getNumber('%M'), getNumber('%S'),
|
|
3432
|
-
getNumber('%f'));
|
|
3428
|
+
return date;
|
|
3433
3429
|
};
|
|
3434
3430
|
|
|
3435
3431
|
Sao.common.format_date = function(date_format, date) {
|
|
@@ -6201,11 +6197,8 @@ var Sao = {
|
|
|
6201
6197
|
load_icons: function(refresh) {
|
|
6202
6198
|
refresh = refresh || false;
|
|
6203
6199
|
if (!refresh) {
|
|
6204
|
-
for (var icon_name in this.
|
|
6205
|
-
|
|
6206
|
-
continue;
|
|
6207
|
-
}
|
|
6208
|
-
window.URL.revokeObjectURL(this.load_icons[icon_name]);
|
|
6200
|
+
for (var icon_name in this.loaded_icons) {
|
|
6201
|
+
window.URL.revokeObjectURL(this.loaded_icons[icon_name]);
|
|
6209
6202
|
}
|
|
6210
6203
|
}
|
|
6211
6204
|
|
|
@@ -6894,7 +6887,7 @@ var Sao = {
|
|
|
6894
6887
|
}
|
|
6895
6888
|
var prm;
|
|
6896
6889
|
if (this.source instanceof Array) {
|
|
6897
|
-
prm = jQuery.when(source.filter(function(value) {
|
|
6890
|
+
prm = jQuery.when(this.source.filter(function(value) {
|
|
6898
6891
|
return value.toLowerCase().startsWith(text.toLowerCase());
|
|
6899
6892
|
}));
|
|
6900
6893
|
} else {
|
|
@@ -14458,7 +14451,6 @@ var Sao = {
|
|
|
14458
14451
|
/* This file is part of Tryton. The COPYRIGHT file at the top level of
|
|
14459
14452
|
this repository contains the full copyright notices and license terms. */
|
|
14460
14453
|
|
|
14461
|
-
/* jshint ignore:start */
|
|
14462
14454
|
// Must be defined in non strict context otherwise is invalid
|
|
14463
14455
|
function eval_pyson(value){
|
|
14464
14456
|
with (Sao.PYSON.eval) {
|
|
@@ -14466,7 +14458,6 @@ function eval_pyson(value){
|
|
|
14466
14458
|
return eval('(' + value + ')');
|
|
14467
14459
|
}
|
|
14468
14460
|
}
|
|
14469
|
-
/* jshint ignore:end */
|
|
14470
14461
|
|
|
14471
14462
|
(function() {
|
|
14472
14463
|
'use strict';
|
|
@@ -15602,7 +15593,7 @@ function eval_pyson(value){
|
|
|
15602
15593
|
var url = new URL(name, window.location);
|
|
15603
15594
|
url.searchParams.set(
|
|
15604
15595
|
this.attributes.url_size,
|
|
15605
|
-
attributes.size || 48);
|
|
15596
|
+
this.attributes.size || 48);
|
|
15606
15597
|
name = url.href;
|
|
15607
15598
|
}
|
|
15608
15599
|
this.img.attr('src', name);
|
|
@@ -22277,7 +22268,7 @@ function eval_pyson(value){
|
|
|
22277
22268
|
return this.attributes.name;
|
|
22278
22269
|
},
|
|
22279
22270
|
get model_name() {
|
|
22280
|
-
return model.name;
|
|
22271
|
+
return this.model.name;
|
|
22281
22272
|
},
|
|
22282
22273
|
get_cell: function() {
|
|
22283
22274
|
var cell = jQuery('<div/>', {
|
|
@@ -23296,7 +23287,7 @@ function eval_pyson(value){
|
|
|
23296
23287
|
for (i = 0; i < this.yfields.length; i++) {
|
|
23297
23288
|
yfield = this.yfields[i];
|
|
23298
23289
|
if (yfield.color) {
|
|
23299
|
-
colors[yfield.key || yfield.name] =
|
|
23290
|
+
colors[yfield.key || yfield.name] = yfield.color;
|
|
23300
23291
|
}
|
|
23301
23292
|
}
|
|
23302
23293
|
c3_config.data.color = function(color, column) {
|
|
@@ -23929,7 +23920,7 @@ function eval_pyson(value){
|
|
|
23929
23920
|
return records;
|
|
23930
23921
|
},
|
|
23931
23922
|
get listed_records() {
|
|
23932
|
-
this.group.slice();
|
|
23923
|
+
return this.group.slice();
|
|
23933
23924
|
},
|
|
23934
23925
|
set_cursor: function(new_, reset_view) {
|
|
23935
23926
|
if (new_) {
|
|
@@ -23983,11 +23974,13 @@ function eval_pyson(value){
|
|
|
23983
23974
|
var current_view_form;
|
|
23984
23975
|
|
|
23985
23976
|
if (event_.shiftKey) {
|
|
23977
|
+
let i = 0;
|
|
23986
23978
|
for (const other_view_form of this._view_forms) {
|
|
23987
|
-
if (
|
|
23979
|
+
if (other_view_form.record === this.record) {
|
|
23988
23980
|
current_view_form = other_view_form;
|
|
23989
23981
|
break;
|
|
23990
23982
|
}
|
|
23983
|
+
i++;
|
|
23991
23984
|
}
|
|
23992
23985
|
this.select_records(i, next_form_idx);
|
|
23993
23986
|
} else {
|
|
@@ -24818,7 +24811,7 @@ function eval_pyson(value){
|
|
|
24818
24811
|
record.modified_fields.id = added;
|
|
24819
24812
|
}
|
|
24820
24813
|
} else {
|
|
24821
|
-
result = response_id != 'RESPONSE_CANCEL';
|
|
24814
|
+
result = (response_id != 'RESPONSE_CANCEL') && !readonly;
|
|
24822
24815
|
}
|
|
24823
24816
|
(cancel_prm || jQuery.when()).then(() => {
|
|
24824
24817
|
if (this.callback) {
|
|
@@ -25691,18 +25684,21 @@ function eval_pyson(value){
|
|
|
25691
25684
|
},
|
|
25692
25685
|
sig_sel_add: function(el_field) {
|
|
25693
25686
|
el_field = jQuery(el_field);
|
|
25694
|
-
|
|
25695
|
-
|
|
25687
|
+
this._add_node(el_field.attr('field'), el_field.attr('name'));
|
|
25688
|
+
},
|
|
25689
|
+
_add_node: function(field, name) {
|
|
25690
|
+
jQuery('<li/>', {
|
|
25696
25691
|
'field': field,
|
|
25697
25692
|
'class': 'draggable-handle',
|
|
25698
|
-
}).text(
|
|
25693
|
+
}).text(name).prepend(
|
|
25699
25694
|
Sao.common.ICONFACTORY.get_icon_img('tryton-drag')
|
|
25700
|
-
).click(function(
|
|
25701
|
-
|
|
25695
|
+
).click(function(evt) {
|
|
25696
|
+
const node = jQuery(evt.target);
|
|
25697
|
+
if (evt.ctrlKey || evt.metaKey) {
|
|
25702
25698
|
node.toggleClass('bg-primary');
|
|
25703
25699
|
} else {
|
|
25704
|
-
|
|
25705
|
-
|
|
25700
|
+
node.addClass('bg-primary');
|
|
25701
|
+
node.siblings().removeClass('bg-primary');
|
|
25706
25702
|
}
|
|
25707
25703
|
}).appendTo(this.fields_selected);
|
|
25708
25704
|
},
|
|
@@ -25843,12 +25839,7 @@ function eval_pyson(value){
|
|
|
25843
25839
|
Sao.i18n.gettext('Error'));
|
|
25844
25840
|
return false;
|
|
25845
25841
|
}
|
|
25846
|
-
|
|
25847
|
-
'field': field
|
|
25848
|
-
}).text(name).click(() => {
|
|
25849
|
-
node.addClass('bg-primary')
|
|
25850
|
-
.siblings().removeClass('bg-primary');
|
|
25851
|
-
}).appendTo(this.fields_selected);
|
|
25842
|
+
this._add_node(field, name);
|
|
25852
25843
|
return true;
|
|
25853
25844
|
},
|
|
25854
25845
|
_traverse: function(fields, prefix, parents, i) {
|
package/dist/tryton-sao.min.css
CHANGED
|
@@ -9955,8 +9955,8 @@ img.icon {
|
|
|
9955
9955
|
.form .form-richtext > textarea,
|
|
9956
9956
|
.form .form-text .richtext,
|
|
9957
9957
|
.form .form-richtext .richtext {
|
|
9958
|
+
height: 100%;
|
|
9958
9959
|
line-height: 2.5ex;
|
|
9959
|
-
max-height: 50ex;
|
|
9960
9960
|
min-height: 12.5ex;
|
|
9961
9961
|
overflow: auto;
|
|
9962
9962
|
resize: vertical;
|