diff options
| author | Christophe Matthieu <chm@odoo.com> | 2015-06-11 17:04:31 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@odoo.com> | 2015-06-11 17:11:21 +0200 |
| commit | 9f000449dca6db583e9b6df1aa3cabf765fe2691 (patch) | |
| tree | 59f3dfd82beb17ac59f96193d0c365105974985b /addons/web/static/src/js | |
| parent | 8f1bb1f72b19f0682bcb700572b5b23e603698ac (diff) | |
[IMP] boot.js: add debugging features on odoo.__DEBUG__ object: get_missing_jobs and get_waited_jobs
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/boot.js | 20 |
1 files 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, |
