- Account Reports Hierarchy
+ Financial Reports Hierarchy
account.financial.report
tree
diff --git a/addons/account/report/account_balance_sheet.py b/addons/account/report/account_balance_sheet.py
index b1e51e6fc46..ce9e3c51f06 100644
--- a/addons/account/report/account_balance_sheet.py
+++ b/addons/account/report/account_balance_sheet.py
@@ -136,7 +136,7 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header)
'code': account.code,
'name': account.name,
'level': account.level,
- 'balance':account.balance,
+ 'balance': account.balance != 0 and account.balance * account.user_type.sign or account.balance,
'type': account.type,
}
currency = account.currency_id and account.currency_id or account.company_id.currency_id
diff --git a/addons/account/report/account_financial_report.py b/addons/account/report/account_financial_report.py
index 6b0ada74708..6b42bb1875d 100644
--- a/addons/account/report/account_financial_report.py
+++ b/addons/account/report/account_financial_report.py
@@ -63,14 +63,18 @@ class report_account_common(report_sxw.rml_parse, common_report_header):
if data['form']['enable_filter']:
vals['balance_cmp'] = self.pool.get('account.financial.report').browse(self.cr, self.uid, report.id, context=data['form']['comparison_context']).balance
lines.append(vals)
+ account_ids = []
if report.type == 'accounts' and report.display_detail and report.account_ids:
account_ids = account_obj._get_children_and_consol(self.cr, self.uid, [x.id for x in report.account_ids])
+ elif report.type == 'account_type' and report.account_type_ids:
+ 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 account.type != 'view':
flag = False
vals = {
'name': account.code + ' ' + account.name,
- 'balance': account.balance,
+ 'balance': account.balance != 0 and account.balance * account.user_type.sign or account.balance,
'type': 'account',
'level': 6,
'account_type': account.type,
diff --git a/addons/account/report/account_profit_loss.py b/addons/account/report/account_profit_loss.py
index 4c8896ee630..27182cdbd21 100644
--- a/addons/account/report/account_profit_loss.py
+++ b/addons/account/report/account_profit_loss.py
@@ -141,11 +141,15 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header):
'code': cal_list['expense'][i].code,
'name': cal_list['expense'][i].name,
'level': cal_list['expense'][i].level,
- 'balance':cal_list['expense'][i].balance,
+ 'balance': cal_list['expense'][i].balance != 0 and \
+ cal_list['expense'][i].balance * cal_list['expense'][i].user_type.sign or \
+ cal_list['expense'][i].balance,
'code1': cal_list['income'][i].code,
'name1': cal_list['income'][i].name,
'level1': cal_list['income'][i].level,
- 'balance1':cal_list['income'][i].balance,
+ 'balance1': cal_list['income'][i].balance != 0 and \
+ cal_list['income'][i].balance * cal_list['income'][i].user_type.sign or \
+ cal_list['income'][i].balance,
}
self.result_temp.append(temp)
else:
@@ -158,7 +162,9 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header):
'code1': cal_list['income'][i].code,
'name1': cal_list['income'][i].name,
'level1': cal_list['income'][i].level,
- 'balance1':cal_list['income'][i].balance,
+ 'balance1': cal_list['income'][i].balance != 0 and \
+ cal_list['income'][i].balance * cal_list['income'][i].user_type.sign \
+ or cal_list['income'][i].balance,
}
self.result_temp.append(temp)
if i < len(cal_list['expense']):
@@ -166,7 +172,9 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header):
'code': cal_list['expense'][i].code,
'name': cal_list['expense'][i].name,
'level': cal_list['expense'][i].level,
- 'balance':cal_list['expense'][i].balance,
+ 'balance': cal_list['expense'][i].balance != 0 and \
+ cal_list['expense'][i].balance * cal_list['expense'][i].user_type.sign \
+ or cal_list['expense'][i].balance,
'code1': '',
'name1': '',
'level1': False,
diff --git a/addons/account/report/account_profit_loss.rml b/addons/account/report/account_profit_loss.rml
index 3b6aa102ce9..362381be6a8 100644
--- a/addons/account/report/account_profit_loss.rml
+++ b/addons/account/report/account_profit_loss.rml
@@ -228,8 +228,8 @@
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,a.level))}) ]]
| [[ (a.type =='view' and a.level >= 3) and setTag('para','para',{'style': 'terp_level_3_code_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_code'}) ]][[ a.code ]] |
[[ (a.type =='view' and a.level >= 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 ]] |
- [[ (a.level <>2) or removeParentNode('td') ]][[ (a.type =='view' and a.level >= 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, currency_obj=company.currency_id) ]] |
- [[ a.level == 2 or removeParentNode('td') ]][[ formatLang(a.balance, currency_obj=company.currency_id) ]] |
+ [[ (a.level <>2) or removeParentNode('td') ]][[ (a.type =='view' and a.level >= 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 * a.user_type.sign, currency_obj=company.currency_id.symbol) |
+ [[ a.level == 2 or removeParentNode('td') ]][[ formatLang(a.balance * a.user_type.sign, currency_obj=company.currency_id) ]] |
@@ -277,8 +277,8 @@
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,a.level))}) ]]
[[ (a.type =='view' and a.level >= 3) and setTag('para','para',{'style': 'terp_level_3_code_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_code'}) ]][[ a.code ]] |
[[ (a.type =='view' and a.level >= 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 ]] |
- [[ (a.level <>2) or removeParentNode('td') ]][[ (a.type =='view' and a.level >= 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, currency_obj=company.currency_id) ]] |
- [[ a.level == 2 or removeParentNode('td') ]][[ formatLang(a.balance, currency_obj=company.currency_id) ]] |
+ [[ (a.level <>2) or removeParentNode('td') ]][[ (a.type =='view' and a.level >= 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 * a.user_type.sign, currency_obj=company.currency_id) ]] |
+ [[ a.level == 2 or removeParentNode('td') ]][[ formatLang(a.balance * a.user_type.sign, currency_obj=company.currency_id) ]] |
diff --git a/addons/account/wizard/account_financial_report_view.xml b/addons/account/wizard/account_financial_report_view.xml
index 2083fd0ed53..1472da4ba87 100644
--- a/addons/account/wizard/account_financial_report_view.xml
+++ b/addons/account/wizard/account_financial_report_view.xml
@@ -31,7 +31,7 @@