Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8.0 meshrelation #54

Merged
merged 3 commits into from
Jun 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions module_dependencies_view/controllers.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
# -*- coding: utf-8 -*-
from datetime import datetime
from datetime import timedelta
from openerp import http
from pprint import pprint


class ModuleDependenciesView(http.Controller):

@http.route('/module/one/<model("ir.module.module"):module>/',
auth='user')
def module_level(self, module):
start = datetime.now()
depends = module.with_context({'one_level': True}).depends()
end = datetime.now()
computed = end - start
return http.request.render('module_dependencies_view.module', {
'object': module,
'tree': depends,
'start': start,
'end': end,
'computed': computed,
})

@http.route('/module/<model("ir.module.module"):module>/',
auth='user')
def module(self, module):
Expand All @@ -20,3 +34,25 @@ def module(self, module):
'end': end,
'computed': computed,
})

@http.route('/module/dendrogram/<model("ir.module.module"):module>/',
auth='user')
def cluster_dendgram(self, module):
depends = module.with_context({'with_id': True}).depends()
return depends

@http.route('/module/mesh/<model("ir.module.module"):module>/',
auth='user')
def module_mesh(self, module):
start = datetime.now()
depends = module.depends()
end = datetime.now()
computed = end - start
return http.request.render(
'module_dependencies_view.cluster_dendrogram', {
'object': module,
'tree': depends,
'start': start,
'end': end,
'computed': computed,
})
Loading