summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/boot.js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2017-03-05 10:05:56 +0100
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commit905e01921f3c3ef43ace6fc537d1d8c0d280002c (patch)
tree265c43ab21c5401a5d9f0f3d64d86f1ac417451c /addons/web/static/src/js/boot.js
parent54d4c73af4ad05c7640d28c1892247c9538b8017 (diff)
[REF] web, *: redesign all JS views
This commit introduce a full redesign of all JS views. We started basically from scratch. The goal was to unify all the various views under a common framework, to make them testable, to make then usable in different conditions (in studio, or in the frontend), and to make our lives easier. Some important points are: - we introduced new coding guidelines (camelCase, 80 chars width, ...) - we have a brand new testing framework (still QUnit based) - kanban view moved to the web addon - calendar view (formerly web_calender) moved to web as well - the tree view was removed - all new code should be documented We hope that this code is the start of a new era for the Odoo web client, we want to have a high quality codebase, well documented, well tested, well designed. Work done by the framework team: mostly aab, ged, chm, dmo, qsm
Diffstat (limited to 'addons/web/static/src/js/boot.js')
-rw-r--r--addons/web/static/src/js/boot.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/addons/web/static/src/js/boot.js b/addons/web/static/src/js/boot.js
index b84cd0f58f8..9d299b1da84 100644
--- a/addons/web/static/src/js/boot.js
+++ b/addons/web/static/src/js/boot.js
@@ -36,6 +36,7 @@
var job_deps = [];
var job_deferred = [];
+
var services = Object.create({});
var commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg;
@@ -50,6 +51,7 @@
remaining_jobs: jobs,
__DEBUG__: {
+ didLogInfo: $.Deferred(),
get_dependencies: function (name, transitive) {
var deps = name instanceof Array ? name: [name],
changed;
@@ -137,6 +139,9 @@
this.process_jobs(jobs, services);
},
log: function () {
+ var missing = [];
+ var failed = [];
+
if (jobs.length) {
var debug_jobs = {};
var rejected = [];
@@ -176,8 +181,8 @@
}
}
}
- var missing = odoo.__DEBUG__.get_missing_jobs();
- var failed = odoo.__DEBUG__.get_failed_jobs();
+ missing = odoo.__DEBUG__.get_missing_jobs();
+ 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'];
@@ -192,10 +197,14 @@
console[_.isEmpty(failed) || _.isEmpty(unloaded) ? 'info' : 'error'].apply(console, log);
}
}
+ odoo.__DEBUG__.js_modules = {
+ missing: missing,
+ failed: _.pluck(failed, 'name'),
+ };
+ odoo.__DEBUG__.didLogInfo.resolve();
},
process_jobs: function (jobs, services) {
var job;
- var require;
function process_job (job) {
var require = make_require(job);
@@ -252,6 +261,7 @@
}
});
+
// automatically log errors detected when loading modules
var log_when_loaded = function () {
_.delay(function () {