diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index c8d17c2cf9e..c4aa24cacb9 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -121,8 +121,8 @@ module named account_voucher. 'ir_sequence_view.xml', 'company_view.xml', 'board_account_view.xml', - "wizard/account_report_profit_loss_view.xml", - "wizard/account_report_balance_sheet_view.xml", + #"wizard/account_report_profit_loss_view.xml", + #"wizard/account_report_balance_sheet_view.xml", "edi/invoice_action_data.xml", "account_bank_view.xml", "account_pre_install.yml" diff --git a/addons/account/account.py b/addons/account/account.py index 3a3277eecb1..1455c86aa33 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -154,13 +154,11 @@ class account_account_type(osv.osv): 'Balance' will generally be used for cash accounts. 'Detail' will copy each existing journal item of the previous year, even the reconciled ones. 'Unreconciled' will copy only the journal items that were unreconciled on the first day of the new fiscal year."""), - 'sign': fields.selection([(-1, 'Reverse balance sign'), (1, 'Preserve balance sign')], 'Sign on Reports', required=True, help='For accounts that are typically more debited than credited and that you would like to print as negative amounts in your reports, you should reverse the sign of the balance; e.g.: Expense account. The same applies for accounts that are typically more credited than debited and that you would like to print as positive amounts in your reports; e.g.: Income account.'), 'report_type': fields.selection(_get_report_type, 'P&L / BS Category', help="This field is used to generate legal reports: profit and loss, balance sheet.", required=True), 'note': fields.text('Description'), } _defaults = { 'close_method': 'none', - 'sign': 1, 'report_type': 'none', } _order = "code" @@ -2789,11 +2787,13 @@ class account_financial_report(osv.osv): ], 'Display details'), 'account_report_id': fields.many2one('account.financial.report', 'Report Value'), 'account_type_ids': fields.many2many('account.account.type', 'account_account_financial_report_type', 'report_id', 'account_type_id', 'Account Types'), + 'sign': fields.selection([(-1, 'Reverse balance sign'), (1, 'Preserve balance sign')], 'Sign on Reports', required=True, help='For accounts that are typically more debited than credited and that you would like to print as negative amounts in your reports, you should reverse the sign of the balance; e.g.: Expense account. The same applies for accounts that are typically more credited than debited and that you would like to print as positive amounts in your reports; e.g.: Income account.'), } _defaults = { 'type': 'sum', 'display_detail': 'only_detail', + 'sign': 1, } account_financial_report() diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 28aacdbcec1..c3daf8d9c06 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -786,7 +786,6 @@ - @@ -2767,6 +2766,7 @@ action = pool.get('res.config').next(cr, uid, [], context) + diff --git a/addons/account/configurable_account_chart.xml b/addons/account/configurable_account_chart.xml index 0ac7a51405d..8486e2fb008 100644 --- a/addons/account/configurable_account_chart.xml +++ b/addons/account/configurable_account_chart.xml @@ -4,14 +4,12 @@ Receivable receivable - income unreconciled Payable payable - expense unreconciled @@ -24,86 +22,159 @@ Income View view - income Expense View expense - expense Asset View asset - asset Liability View liability - liability Income income - income none Expense expense - expense none Tax tax - expense unreconciled Cash cash - asset balance Liability liability - liability balance Asset asset - asset balance Equity equity - liability balance - + Bank bank - asset balance - + Check check - asset balance + + + Balance Sheet + sum + + + Assets + + + detail_with_hierarchy + account_type + + + Liability + + + detail_with_hierarchy + account_type + + + + Profit and Loss + sum + + + Income + + + detail_with_hierarchy + account_type + + + Expense + + + detail_with_hierarchy + account_type + + + + + + asset + + + liability + + + income + + + expense + + + asset + + + liability + + + liability + + + asset + + + income + + + expense + + + asset + + + liability + + + expense + + + asset + + + asset + diff --git a/addons/account/report/__init__.py b/addons/account/report/__init__.py index 90254c53bda..f7d82ffebce 100644 --- a/addons/account/report/__init__.py +++ b/addons/account/report/__init__.py @@ -33,13 +33,13 @@ import account_print_overdue import account_aged_partner_balance #import tax_report import account_tax_report -import account_balance_landscape +#import account_balance_landscape import account_invoice_report import account_report import account_entries_report import account_analytic_entries_report -import account_balance_sheet -import account_profit_loss +#import account_balance_sheet +#import account_profit_loss import account_treasury_report import account_financial_report diff --git a/addons/account/report/account_financial_report.py b/addons/account/report/account_financial_report.py index 43fc2efb378..ab8f3f7cb6f 100644 --- a/addons/account/report/account_financial_report.py +++ b/addons/account/report/account_financial_report.py @@ -78,7 +78,7 @@ class report_account_common(report_sxw.rml_parse, common_report_header): flag = False vals = { 'name': account.code + ' ' + account.name, - 'balance': account.balance != 0 and account.balance * account.user_type.sign or account.balance, + 'balance': account.balance != 0 and account.balance * report.sign or account.balance, 'type': 'account', 'level': 6, 'account_type': account.type, diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml index 40ba7ea7127..c2797f274e7 100644 --- a/addons/account/test/account_report.yml +++ b/addons/account/test/account_report.yml @@ -37,24 +37,15 @@ data_dict = {'chart_account_id':ref('account.chart0')} from tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account') -- - Print the Account Balance Sheet in Horizontal mode -- - !python {model: account.account}: | - ctx={} - ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]}) - data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True} - from tools import test_reports - test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account') - Print the Account Balance Sheet in Normal mode - !python {model: account.account}: | ctx={} ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]}) - data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False} + data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False, 'account_report_id': ref('account_financial_report_balancesheet0')} from tools import test_reports - test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account') + test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account') - Print the Account Balance Report in Normal mode through the wizard - From Account Chart - @@ -147,18 +138,9 @@ !python {model: account.account}: | ctx={} ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]}) - data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False,'target_move': 'all'} + data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False,'target_move': 'all', 'account_report_id': ref('account_financial_report_balancesheet0')} from tools import test_reports - test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account') -- - Print the Profit-Loss Report in Horizontal Mode -- - !python {model: account.account}: | - ctx={} - ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]}) - data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True,'target_move': 'all'} - from tools import test_reports - test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account') + test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account') - Print the Analytic Balance Report through the wizard - diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py index 88ae17f3c7b..bef2c78ac01 100644 --- a/addons/account/wizard/__init__.py +++ b/addons/account/wizard/__init__.py @@ -64,8 +64,8 @@ import account_report_account_balance import account_change_currency -import account_report_balance_sheet -import account_report_profit_loss +#import account_report_balance_sheet +#import account_report_profit_loss # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_financial_report.py b/addons/account/wizard/account_financial_report.py index de9cae3a00c..92c623a9524 100644 --- a/addons/account/wizard/account_financial_report.py +++ b/addons/account/wizard/account_financial_report.py @@ -38,9 +38,19 @@ class accounting_report(osv.osv_memory): 'date_to_cmp': fields.date("End Date"), } + def _get_account_report(self, cr, uid, context=None): + menu_obj = self.pool.get('ir.ui.menu') + report_obj = self.pool.get('account.financial.report') + report_ids = [] + if context.get('active_id'): + menu = menu_obj.browse(cr, uid, context.get('active_id')).name + report_ids = report_obj.search(cr, uid, [('name','ilike',menu)]) + return report_ids and report_ids[0] or False + _defaults = { 'filter_cmp': 'filter_no', 'target_move': 'posted', + 'account_report_id': _get_account_report, } def _build_comparison_context(self, cr, uid, ids, data, context=None): diff --git a/addons/account/wizard/account_financial_report_view.xml b/addons/account/wizard/account_financial_report_view.xml index 1472da4ba87..4be6fb5e95c 100644 --- a/addons/account/wizard/account_financial_report_view.xml +++ b/addons/account/wizard/account_financial_report_view.xml @@ -40,6 +40,24 @@ new + + + + + +