From 56a13155f4b952f7e2133f0e8fc661753fd533fe Mon Sep 17 00:00:00 2001 From: qdp Date: Thu, 22 Jan 2009 13:21:02 +0100 Subject: [PATCH] [IMP] added the possibility to create an account_report_report with expression like balance(['2-3']) which mean that the serach criterion may now be a range of accounts bzr revid: qdp@tinyerp.com-20090122122102-r9b6v0hwsb606ig3 --- addons/account_report/account.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/account_report/account.py b/addons/account_report/account.py index ea925198c20..517e3d08bcd 100644 --- a/addons/account_report/account.py +++ b/addons/account_report/account.py @@ -89,8 +89,11 @@ class account_report(osv.osv): if not context['fiscalyear']: del context['fiscalyear'] acc = self.pool.get('account.account') - acc_id = acc.search(cr, uid, [('code','in',code)]) - return reduce(lambda y,x=0: x.balance+y, acc.browse(cr, uid, acc_id, context),0.0) + account_ids = [] + for c in code: + for i in c.split('-'): + account_ids += acc.search(cr, uid, [('code', 'ilike', i)]) + return reduce(lambda y,x=0: x.balance+y, acc.browse(cr, uid, account_ids, context),0.0) def _calc_report(*code): acc = self.pool.get('account.report.report')