[IMP] account: Improved formatting of account report.

bzr revid: uco@tinyerp.com-20110825073846-h2cbkruz0le2ossm
This commit is contained in:
Ujjvala Collins (OpenERP) 2011-08-25 13:08:46 +05:30
parent a4f082006f
commit d3a3f5ba3a
2 changed files with 24 additions and 20 deletions

View File

@ -110,6 +110,8 @@ class report_account_common(report_sxw.rml_parse, common_report_header):
'name': account.code + ' ' + account.name,
'balance': account.balance,
'type': 'account',
'level': account.level,
'account_type': account.type,
}
if data['form']['enable_filter']:
vals['balance_cmp'] = self.pool.get('account.account').browse(self.cr, self.uid, account.id, context=data['form']['comparison_context']).balance

View File

@ -231,8 +231,8 @@
<font color="white"> </font>
</para>
<para style="terp_header">Accounts</para>
<blockTable colWidths="263.0,100.0" style="Table_Account_Line_Title">
[[data['form']['enable_filter'] == False or removeParentNote('blockTable')]]
<blockTable colWidths="330.0,160.0" style="Table_Account_Line_Title">
[[ data['form']['enable_filter'] == 0 or removeParentNode('blockTable') ]]
<tr>
<td>
<para style="terp_default_Bold_9">Name</para>
@ -243,23 +243,19 @@
</tr>
<tr style="Table3">
[[ repeatIn(get_lines(data), 'a') ]]
<td>[[a.get('name', '')]]</td>
<td>[[a.get('balance',0.0)]]</td>
<!--
[[ repeatIn(get_account_details(r['id'], data), 'a') ]]
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,a.level))}) ]]
<td><para style="terp_level_3_code">[[ (a.type =='view' and a.level &gt;= 3) and setTag('para','para',{'style': 'terp_level_3_code_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_code'}) ]]<i>[[ a.code ]]</i></para></td>
<td><para style="terp_level_3_name">[[ (a.type =='view' and a.level &gt;= 3) and setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_name_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(4,a.level))+'_name'}) ]][[ a.name ]]</para></td>
<td>[[ (a.level &lt;&gt;2) or removeParentNode('td') ]]<para style="terp_level_3_balance">[[ (a.type =='view' and a.level &gt;= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_balance'}) ]][[ formatLang(a.balance) ]] [[company.currency_id.symbol ]]</para></td>
<td>[[ a.level == 2 or removeParentNode('td') ]]<para style="terp_level_2_balance"><u>[[ formatLang(a.balance) ]] [[company.currency_id.symbol ]]</u></para></td>
<td>[[ get_filter(data)!='No Filter' and (a.level &lt;&gt;2) or removeParentNode('td') ]]<para style="terp_level_3_balance">[[ (a.type =='view' and a.level &gt;= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_balance'}) ]][[ formatLang(a.balance) ]] [[company.currency_id.symbol ]]</para></td>
<td>[[ get_filter(data)!='No Filter' and a.level == 2 or removeParentNode('td') ]]<para style="terp_level_2_balance"><u>[[ formatLang(a.balance) ]] [[company.currency_id.symbol ]]</u></para></td>
-->
<td><para style="terp_level_1_name">[[ a.get('type')=='report' and a.get('name') or removeParentNode('td') ]]</para></td>
<td><para style="terp_level_1_balance">[[ a.get('type')=='report' and formatLang(a.get('balance')) or removeParentNode('td') ]][[company.currency_id.symbol ]]</para></td>
<td><para style="terp_level_3_name">[[ a.get('type') == 'account' and a.get('name') or removeParentNode('td') ]]
[[ a.get('type')=='account' and (a.get('account_type')=='view' and a.get('level',1) &gt;= 3) and setTag('para','para',{'style': 'terp_level_'+str(min(3,a.get('level',1)))+'_name_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(4,a.get('level',1)))+'_name'}) ]]</para></td>
<td>[[ a.get('type')=='account' and (a.get('level',1) &lt;&gt;2) or removeParentNode('td') ]]<para style="terp_level_3_balance">[[ (a.get('account_type') == 'view' and a.get('level',1) &gt;= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.get('level',1)))+'_balance'}) ]][[ formatLang(a.get('balance')) ]][[company.currency_id.symbol ]]</para></td>
<td>[[ a.get('type')=='account' and a.get('level',1) == 2 or removeParentNode('td') ]]<para style="terp_level_2_balance"><u>[[ formatLang(a.get('balance')) ]] [[company.currency_id.symbol ]]</u></para></td>
</tr>
</blockTable>
<para style="Standard">
<font color="white"> </font>
</para>
<blockTable colWidths="263.0,100.0,100" style="Table_Account_Line_Title">
[[data['form']['enable_filter'] == True or removeParentNote('blockTable')]]
[[ data['form']['enable_filter'] == 1 or removeParentNode('blockTable') ]]
<tr>
<td>
<para style="terp_default_Bold_9">Name</para>
@ -268,14 +264,20 @@
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[data['form']['label_filter']]]</para>
<para style="terp_tblheader_Details_Right">[[ data['form']['label_filter'] ]]</para>
</td>
</tr>
<tr style="Table3">
[[ repeatIn(get_lines(data), 'a') ]]
<td>[[a.get('name', '')]]</td>
<td>[[a.get('balance',0.0)]]</td>
<td>[[a.get('balance_cmp',0.0)]]</td>
<td><para style="terp_level_1_name">[[ a.get('type')=='report' and a.get('name') or removeParentNode('td') ]]</para></td>
<td><para style="terp_level_1_balance">[[ a.get('type')=='report' and formatLang(a.get('balance')) or removeParentNode('td') ]][[company.currency_id.symbol ]]</para></td>
<td><para style="terp_level_1_balance">[[ a.get('type')=='report' and formatLang(a.get('balance_cmp')) or removeParentNode('td') ]][[company.currency_id.symbol ]]</para></td>
<td><para style="terp_level_3_name">[[ a.get('type') == 'account' and a.get('name') or removeParentNode('td') ]]
[[ a.get('type')=='account' and (a.get('account_type')=='view' and a.get('level',1) &gt;= 3) and setTag('para','para',{'style': 'terp_level_'+str(min(3,a.get('level',1)))+'_name_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(4,a.get('level',1)))+'_name'}) ]]</para></td>
<td>[[ a.get('type')=='account' and (a.get('level',1) &lt;&gt;2) or removeParentNode('td') ]]<para style="terp_level_3_balance">[[ (a.get('account_type') == 'view' and a.get('level',1) &gt;= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.get('level',1)))+'_balance'}) ]][[ formatLang(a.get('balance')) ]][[company.currency_id.symbol ]]</para></td>
<td>[[ a.get('type')=='account' and a.get('level',1) == 2 or removeParentNode('td') ]]<para style="terp_level_2_balance"><u>[[ formatLang(a.get('balance')) ]] [[company.currency_id.symbol ]]</u></para></td>
<td>[[ a.get('type')=='account' and (a.get('level',1) &lt;&gt;2) or removeParentNode('td') ]]<para style="terp_level_3_balance">[[ (a.get('account_type') == 'view' and a.get('level',1) &gt;= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.get('level',1)))+'_balance'}) ]][[ formatLang(a.get('balance_cmp')) ]][[company.currency_id.symbol ]]</para></td>
<td>[[ a.get('type')=='account' and a.get('level',1) == 2 or removeParentNode('td') ]]<para style="terp_level_2_balance"><u>[[ formatLang(a.get('balance_cmp')) ]] [[company.currency_id.symbol ]]</u></para></td>
</tr>
</blockTable>
<para style="Standard">