From 7f3bf1c5d22bab7a11456a930ea0f33d372855e0 Mon Sep 17 00:00:00 2001 From: Dhara Shah Date: Fri, 11 May 2007 06:45:54 +0000 Subject: [PATCH] with indentation bzr revid: dsh@tinyerp.com-6218996c58be07484586dd9f8e8f338e2ca1b6c4 --- .../report/accounting_report.py | 7 +- .../report/accounting_report.rml | 115 ++++++++++++++---- 2 files changed, 97 insertions(+), 25 deletions(-) diff --git a/addons/account_report/report/accounting_report.py b/addons/account_report/report/accounting_report.py index cb8f13abceb..2d85966a116 100755 --- a/addons/account_report/report/accounting_report.py +++ b/addons/account_report/report/accounting_report.py @@ -38,18 +38,21 @@ class accounting_report(report_sxw.rml_parse): 'childs':self.process }) - def process(self,id): + def process(self,id,level=0): res = pooler.get_pool(self.cr.dbname).get('account.report.report').read(self.cr,self.uid,[id]) ret_dict={ 'name':res[0]['name'], 'code':res[0]['code'], 'amount':res[0]['amount'], 'note':res[0]['note'], + 'level': level, + 'color_font':res[0]['color_font'], } self.ret_list.append(ret_dict) for child_id in res[0]['child_ids']: - self.process(child_id) + self.process(child_id,level+1) + print "====return list=========",self.ret_list return self.ret_list diff --git a/addons/account_report/report/accounting_report.rml b/addons/account_report/report/accounting_report.rml index 6600624a457..2f485c27662 100644 --- a/addons/account_report/report/accounting_report.rml +++ b/addons/account_report/report/accounting_report.rml @@ -11,25 +11,50 @@ + + + + + + + + + + - - + + + + + + + - - - - + + + + + + + + + + + + + + @@ -39,38 +64,82 @@ - [[repeatIn(objects,'o')]] + [[ repeatIn(objects,'o') ]] + + + + + + + + + Accounting Report + + + + + + + + + + [[ company.name ]] + + + + + + + + Currency: [[ company.currency_id.name]] + + + + Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] + + + + Name + + + Code + + + Amount + + + + + +
- + [[repeatIn(childs(o.id),'obj')]] + - Name + [[ " "*(obj['level']) + obj['name'] ]][[ setTag('para','xpre') ]] - Code + [[obj['code'] ]] - Amount - - - Notes + [['%.2f' % obj['amount'] ]] - - - [[ repeatIn(childs(o.id),'obj') ]] - [[ obj['name'] ]] + [[ repeatIn((obj['note'] and obj['note'].splitlines()) or [], 'l') ]] + [[ l or removeParentNode('table') ]] - [[ obj['code'] ]] + + + - [[ obj['amount'] ]] - - - [[ obj['note'] ]] + + +