From d0db083ffecd79d5ee22aa17fdc1e26b77e3c2bb Mon Sep 17 00:00:00 2001 From: Lorenzo Battistini Date: Thu, 26 Sep 2013 18:14:02 +0200 Subject: [PATCH] [FIX] using 'type' to make bold accounts --- .../report/account_balance_sheet.py | 8 +++++++- .../report/account_balance_sheet_horizontal.rml | 13 ++++++------- .../report/account_profit_horizontal.rml | 14 ++++++++------ .../report/account_profit_loss.py | 7 +++++++ 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/account_financial_report_horizontal/report/account_balance_sheet.py b/account_financial_report_horizontal/report/account_balance_sheet.py index 75c2559c..a4ff96b8 100644 --- a/account_financial_report_horizontal/report/account_balance_sheet.py +++ b/account_financial_report_horizontal/report/account_balance_sheet.py @@ -145,6 +145,7 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header) 'name': account.name, 'level': account.level, 'balance': (account.balance and typ == 'liability' and -1 or 1 ) * account.balance, + 'type': account.type, } currency = account.currency_id and account.currency_id or account.company_id.currency_id if typ == 'liability' and account.type <> 'view' and (account.debit <> account.credit): @@ -177,10 +178,12 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header) 'name': cal_list['liability'][i]['name'], 'level': cal_list['liability'][i]['level'], 'balance':cal_list['liability'][i]['balance'], + 'type':cal_list['liability'][i]['type'], 'code1': cal_list['asset'][i]['code'], 'name1': cal_list['asset'][i]['name'], 'level1': cal_list['asset'][i]['level'], 'balance1':cal_list['asset'][i]['balance'], + 'type1':cal_list['asset'][i]['type'], } self.result_temp.append(temp) else: @@ -190,10 +193,11 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header) 'name': '', 'level': False, 'balance':False, + 'type':False, 'code1': cal_list['asset'][i]['code'], 'name1': cal_list['asset'][i]['name'], 'level1': cal_list['asset'][i]['level'], - 'balance1':cal_list['asset'][i]['balance'], + 'type1':cal_list['asset'][i]['type'], } self.result_temp.append(temp) if i < len(cal_list['liability']): @@ -202,10 +206,12 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header) 'name': cal_list['liability'][i]['name'], 'level': cal_list['liability'][i]['level'], 'balance':cal_list['liability'][i]['balance'], + 'type':cal_list['liability'][i]['type'], 'code1': '', 'name1': '', 'level1': False, 'balance1':False, + 'type1':False, } self.result_temp.append(temp) return None diff --git a/account_financial_report_horizontal/report/account_balance_sheet_horizontal.rml b/account_financial_report_horizontal/report/account_balance_sheet_horizontal.rml index 11e3daf2..b2ab55a6 100644 --- a/account_financial_report_horizontal/report/account_balance_sheet_horizontal.rml +++ b/account_financial_report_horizontal/report/account_balance_sheet_horizontal.rml @@ -197,27 +197,26 @@ - [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['code1'] ]] + [[ a['type1'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['code1'] ]] - [[ '. '*(a['level1']-1) ]][[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name1'] ]] + [[ '. '*(a['level1']-1) ]][[ a['type1'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name1'] ]] - [[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]] + [[ a['type1'] == 'view' and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]] [[ a['code1'] and formatLang(a['balance1']) or removeParentNode('font') ]] [[ company.currency_id.symbol ]] - [[ repeatIn(get_lines(), 'a') ]] [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['code'] ]][[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Bold_9'}) or removeParentNode('font') ]] + [[ repeatIn(get_lines(), 'a') ]] [[ a['type'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['code'] ]] - [[ '. '*(a['level']-1) ]][[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]][[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Bold_9'}) or removeParentNode('font') ]] + [[ '. '*(a['level']-1) ]][[ a['type'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]] - [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]] - [[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Right_9_Bold'}) or removeParentNode('font') ]] + [[ a['type'] == 'view' and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]] [[ a['code'] and formatLang(a['balance']) or removeParentNode('font') ]] [[ company.currency_id.symbol ]] diff --git a/account_financial_report_horizontal/report/account_profit_horizontal.rml b/account_financial_report_horizontal/report/account_profit_horizontal.rml index c5846931..1504f965 100644 --- a/account_financial_report_horizontal/report/account_profit_horizontal.rml +++ b/account_financial_report_horizontal/report/account_profit_horizontal.rml @@ -213,33 +213,35 @@ - [[ repeatIn(get_lines(),'a' ) ]] [[ a['code'] ]][[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]] + [[ repeatIn(get_lines(),'a' ) ]] + [[ a['code'] ]] + [[ a['type'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]] - [[ '. '*(a['level']-1) ]][[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]] + [[ '. '*(a['level']-1) ]][[ a['type'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]] - [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]] + [[ a['type'] == 'view' and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]] [[ a['code'] and formatLang(a['balance']) or removeParentNode('font') ]] [[ company.currency_id.symbol ]] - [[ a['code1'] ]][[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]] + [[ a['code1'] ]][[ a['type1'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]] - [[ '. '*(a['level1']-1) ]][[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name1'] ]] + [[ '. '*(a['level1']-1) ]][[ a['type1'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name1'] ]] - [[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]] + [[ a['type1'] == 'view' and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]] [[ a['code1'] and formatLang(a['balance1']) or removeParentNode('font') ]] [[ company.currency_id.symbol ]] diff --git a/account_financial_report_horizontal/report/account_profit_loss.py b/account_financial_report_horizontal/report/account_profit_loss.py index 49aefcff..59f8ee71 100644 --- a/account_financial_report_horizontal/report/account_profit_loss.py +++ b/account_financial_report_horizontal/report/account_profit_loss.py @@ -93,6 +93,7 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header): 'name': account.name, 'level': account.level, 'balance': account.balance and (account_type == 'income' and -1 or 1) * account.balance, + 'type': account.type, } cr, uid = self.cr, self.uid @@ -158,10 +159,12 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header): 'name': cal_list['expense'][i]['name'], 'level': cal_list['expense'][i]['level'], 'balance':cal_list['expense'][i]['balance'], + 'type':cal_list['expense'][i]['type'], 'code1': cal_list['income'][i]['code'], 'name1': cal_list['income'][i]['name'], 'level1': cal_list['income'][i]['level'], 'balance1': cal_list['income'][i]['balance'], + 'type1':cal_list['income'][i]['type'], } self.result_temp.append(temp) else: @@ -171,10 +174,12 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header): 'name': '', 'level': False, 'balance':False, + 'type':False, 'code1': cal_list['income'][i]['code'], 'name1': cal_list['income'][i]['name'], 'level1': cal_list['income'][i]['level'], 'balance1': cal_list['income'][i]['balance'], + 'type1':cal_list['income'][i]['type'], } self.result_temp.append(temp) if i < len(cal_list['expense']): @@ -183,10 +188,12 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header): 'name': cal_list['expense'][i]['name'], 'level': cal_list['expense'][i]['level'], 'balance': cal_list['expense'][i]['balance'], + 'type': cal_list['expense'][i]['type'], 'code1': '', 'name1': '', 'level1': False, 'balance1':False, + 'type1':False, } self.result_temp.append(temp) return None