From 9f000449dca6db583e9b6df1aa3cabf765fe2691 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 11 Jun 2015 17:04:31 +0200 Subject: [PATCH] [IMP] boot.js: add debugging features on odoo.__DEBUG__ object: get_missing_jobs and get_waited_jobs --- addons/web/static/src/js/boot.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/boot.js b/addons/web/static/src/js/boot.js index 007677cc520..e684a218403 100644 --- a/addons/web/static/src/js/boot.js +++ b/addons/web/static/src/js/boot.js @@ -42,11 +42,27 @@ changed = true; } }); - } while (changed && transitive) + } while (changed && transitive); return deps; }, get_dependents: function (name) { - return _.pluck(_.where(job_deps, {from: name}), 'to'); + return _.pluck(_.where(job_deps, {from: name}), 'to'); + }, + get_waited_jobs: function () { + return _.uniq(_.map(jobs, function(job) {return job.name;})); + }, + get_missing_jobs: function () { + var self = this; + var waited = this.get_waited_jobs(); + var missing = []; + _.each(waited, function(job) { + _.each(self.get_dependencies(job), function(job) { + if (!(job in self.services)) { + missing.push(job); + } + }); + }); + return _.difference(_.uniq(missing), waited); }, factories: factories, services: services,