From 84087f97b91ff4e3c9bd0d44d13cb800f85d5cf9 Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Mon, 28 Jun 2010 16:52:36 +0200 Subject: [PATCH] [FIX] account: print journal report now works if called from menuitem bzr revid: qdp-launchpad@tinyerp.com-20100628145236-hsnkdhwzx0m8mnxy --- addons/account/report/account_journal.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/addons/account/report/account_journal.py b/addons/account/report/account_journal.py index 5b8418be430..d9c80d89350 100644 --- a/addons/account/report/account_journal.py +++ b/addons/account/report/account_journal.py @@ -27,6 +27,16 @@ from report import report_sxw # Use period and Journal for selection or resources # class journal_print(report_sxw.rml_parse): + + def set_context(self, objects, data, ids, report_type = None): + new_ids = ids + if (data['model'] == 'ir.ui.menu'): + new_ids = 'active_ids' in data['form'] and data['form']['active_ids'] or [] + objects = self.pool.get('account.journal.period').browse(self.cr, self.uid, new_ids) + import pdb + pdb.set_trace() + super(journal_print, self).set_context(objects, data, new_ids, report_type) + def __init__(self, cr, uid, name, context={}): super(journal_print, self).__init__(cr, uid, name, context=context) self.localcontext.update( { @@ -70,7 +80,5 @@ class journal_print(report_sxw.rml_parse): return self.cr.fetchone()[0] or 0.0 report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print, header=False) -report_sxw.report_sxw('report.account.journal.period.print.wiz', 'account.journal.period', 'addons/account/report/wizard_account_journal.rml', parser=journal_print, header=False) - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: