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'] ]] + + +