[IMP] account: improvement of financial report printing

bzr revid: qdp-launchpad@openerp.com-20120126192920-fjteiq59ejdt1tzk
This commit is contained in:
Quentin (OpenERP) 2012-01-26 20:29:20 +01:00
parent 53b298a4c8
commit 9a9c8955f4
2 changed files with 6 additions and 3 deletions

View File

@ -74,6 +74,9 @@ class report_account_common(report_sxw.rml_parse, common_report_header):
account_ids = account_obj.search(self.cr, self.uid, [('user_type','in', [x.id for x in report.account_type_ids])])
if account_ids:
for account in account_obj.browse(self.cr, self.uid, account_ids, context=data['form']['used_context']):
#if there are accounts to display, we add them to the lines with a level equals to their level in
#the COA + 1 (to avoid having them with a too low level that would conflicts with the level of data
#financial reports for Assets, liabilities...)
if report.display_detail == 'detail_flat' and account.type == 'view':
continue
flag = False
@ -81,7 +84,7 @@ class report_account_common(report_sxw.rml_parse, common_report_header):
'name': account.code + ' ' + account.name,
'balance': account.balance != 0 and account.balance * report.sign or account.balance,
'type': 'account',
'level': report.display_detail == 'detail_with_hierarchy' and min(account.level,6) or 6,
'level': report.display_detail == 'detail_with_hierarchy' and min(account.level + 1,6) or 6, #account.level + 1
'account_type': account.type,
}
if not currency_obj.is_zero(self.cr, self.uid, account.company_id.currency_id, vals['balance']):

View File

@ -127,8 +127,8 @@
<paraStyle name="terp_level_0_name" fontName="Helvetica-Bold" fontSize="9.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_0_balance" fontName="Helvetica-Bold" fontSize="9.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_1_name" fontName="Helvetica-Bold" fontSize="9.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_1_balance" fontName="Helvetica-Bold" fontSize="9.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_1_name" fontName="Helvetica-Bold" fontSize="10.0" alignment="LEFT" leading="20" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_1_balance" fontName="Helvetica-Bold" fontSize="10.0" alignment="RIGHT" leading="20" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_2_name" fontName="Helvetica-Bold" fontSize="9.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_2_balance" fontName="Helvetica-Bold" fontSize="9.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_3_name" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="10.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>