diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-11-30 14:44:49 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-11-30 14:44:49 +0100 |
| commit | 98539336a5d40de748764ff0a3c16d8cda77b02f (patch) | |
| tree | c5b18d5375f4ac458546ff28b29445be9dce0549 /addons/web/static/src/js | |
| parent | 92f7ecc263ffc252bbec71c9813e12f2933045a2 (diff) | |
| parent | b780e4a0e4389045979fdb82db34e09d4d672cbd (diff) | |
[MERGE] forward port branch saas-14 up to b780e4a0e43
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/boot.js | 31 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/graph_widget.js | 3 |
2 files changed, 23 insertions, 11 deletions
diff --git a/addons/web/static/src/js/boot.js b/addons/web/static/src/js/boot.js index b84cd0f58f8..014a9becc16 100644 --- a/addons/web/static/src/js/boot.js +++ b/addons/web/static/src/js/boot.js @@ -10,7 +10,7 @@ * only when the deferred is resolved, and its value is equal to the resolved value. * The module can be rejected (unloaded). This will be logged in the console as info. * - * logs: + * logs: * Missing dependencies: * These modules do not appear in the page. It is possible that the * JavaScript file is not in the page or that the module name is wrong @@ -180,16 +180,27 @@ var failed = odoo.__DEBUG__.get_failed_jobs(); var unloaded = _.filter(debug_jobs, function (job) { return job.missing; }); - var log = [(_.isEmpty(failed) ? (_.isEmpty(unloaded) ? 'info' : 'warning' ) : 'error') + ':', 'Some modules could not be started']; - if (missing.length) log.push('\nMissing dependencies: ', missing); - if (!_.isEmpty(failed)) log.push('\nFailed modules: ', _.pluck(failed, 'name')); - if (!_.isEmpty(rejected)) log.push('\nRejected modules: ', rejected); - if (!_.isEmpty(rejected_linked))log.push('\nRejected linked modules:', rejected_linked); - if (!_.isEmpty(unloaded)) log.push('\nNon loaded modules: ', _.pluck(unloaded, 'name')); - if (odoo.debug && !_.isEmpty(debug_jobs)) log.push('\nDebug: ', debug_jobs); - if (odoo.debug || !_.isEmpty(failed) || !_.isEmpty(unloaded)) { - console[_.isEmpty(failed) || _.isEmpty(unloaded) ? 'info' : 'error'].apply(console, log); + var log = console[_.isEmpty(failed) || _.isEmpty(unloaded) ? 'info' : 'error'].bind(console); + log((_.isEmpty(failed) ? (_.isEmpty(unloaded) ? 'info' : 'warning') : 'error') + ': Some modules could not be started'); + if (missing.length) { + log('Missing dependencies: ', missing); + } + if (!_.isEmpty(failed)) { + log('Failed modules: ', _.pluck(failed, 'name')); + } + if (!_.isEmpty(rejected)) { + log('Rejected modules: ', rejected); + } + if (!_.isEmpty(rejected_linked)) { + log('Rejected linked modules: ', rejected_linked); + } + if (!_.isEmpty(unloaded)) { + log('Non loaded modules: ', _.pluck(unloaded, 'name')); + } + if (odoo.debug && !_.isEmpty(debug_jobs)) { + log('Debug: ', debug_jobs); + } } } }, diff --git a/addons/web/static/src/js/views/graph_widget.js b/addons/web/static/src/js/views/graph_widget.js index f778c7201ec..36908e65f6b 100644 --- a/addons/web/static/src/js/views/graph_widget.js +++ b/addons/web/static/src/js/views/graph_widget.js @@ -67,7 +67,8 @@ return Widget.extend({ values = []; if (this.groupbys.length === 1) data_pt.value = [data_pt.value]; for (j = 0; j < data_pt.value.length; j++) { - values[j] = this.sanitize_value(data_pt.value[j], data_pt.grouped_on[j]); + var field = _.isArray(data_pt.grouped_on) ? data_pt.grouped_on[j] : data_pt.grouped_on; + values[j] = this.sanitize_value(data_pt.value[j], field); } value = is_count ? data_pt.length : data_pt.aggregates[this.measure]; this.data.push({ |
