diff options
| author | Xavier Morel <xmo@openerp.com> | 2011-09-06 13:57:54 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2011-09-06 13:57:54 +0200 |
| commit | fd6b4fde142ef971de1eb3daa72ef5a38e8a693c (patch) | |
| tree | 275ec7486b38c182932ff285dfcadad87e3b3cb9 /addons/web | |
| parent | 9b82be28f29b709186e013039f96f01c4877c054 (diff) | |
[FIX] reintroduce reports mistakenly removed at revision xmo@openerp.com-20110905142455-1nt310pqzyzk69cp
they probably shouldn't have been called Export
bzr revid: xmo@openerp.com-20110906115754-i19nn5oi9fhqpmbd
Diffstat (limited to 'addons/web')
| -rw-r--r-- | addons/web/controllers/main.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index b7c6ac0cfc9..d9edee1cfca 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1335,3 +1335,26 @@ class ExcelExport(Export): data = fp.read() fp.close() return data + + +class Reports(View): + _cp_path = "/web/report" + + @openerpweb.jsonrequest + def get_report(self, req, action): + report_srv = req.session.proxy("report") + context = req.session.eval_context(openerpweb.nonliterals.CompoundContext(req.context, \ + action["context"])) + + args = [req.session._db, req.session._uid, req.session._password, action["report_name"], context["active_ids"], {"id": context["active_id"], "model": context["active_model"], "report_type": action["report_type"]}, context] + report_id = report_srv.report(*args) + report = None + while True: + args2 = [req.session._db, req.session._uid, req.session._password, report_id] + report = report_srv.report_get(*args2) + if report["state"]: + break + time.sleep(_REPORT_POLLER_DELAY) + + #TODO: ok now we've got the report, and so what? + return False |
