I generated test coverage report using coverage.py for some modules and as output chose html is inside module in folder /coverage/coverage_html/
And now i want to display it to client.
So i create button
inside view:
<button name="action_show_coverage" string="smth" type="object"/>
inside model:
cov= get_module_resource("hr_holidays_limits", "coverage/coverage_html", "index.html")
def action_show_coverage(self,context=None):
return {"type": "ir.actions.act_url",
"url": "file://"+self.cov,
"target": "new" }
And I get this:
I also tried to write controller but it always show error 500 or
classCoverage(http.Controller):
@http.route('/coverage/', website=True, auth='public')
def index(self, **kw):
return request.render(get_module_resource("hr_holidays_limits", "coverage/coverage_html", "index.html"))