diff --git a/account_financial_report_webkit_xls/__openerp__.py b/account_financial_report_webkit_xls/__openerp__.py index 6c2235b3..6ec5babe 100644 --- a/account_financial_report_webkit_xls/__openerp__.py +++ b/account_financial_report_webkit_xls/__openerp__.py @@ -44,6 +44,7 @@ 'wizard/partners_balance_wizard_view.xml', 'wizard/open_invoices_wizard_view.xml', ], + 'test': ['tests/trial_balance.yml'], 'active': False, 'installable': True, } diff --git a/account_financial_report_webkit_xls/report/trial_balance_xls.py b/account_financial_report_webkit_xls/report/trial_balance_xls.py index dd357185..f52d9258 100644 --- a/account_financial_report_webkit_xls/report/trial_balance_xls.py +++ b/account_financial_report_webkit_xls/report/trial_balance_xls.py @@ -251,7 +251,7 @@ class trial_balance_xls(report_xls): cell_style_decimal = regular_cell_style_decimal cell_style_pct = regular_cell_style_pct - comparisons = current_account.comparisons + comparisons = _p['comparisons_accounts'][current_account.id] if current_account.id not in last_child_consol_ids: # current account is a not a consolidation child: use its own diff --git a/account_financial_report_webkit_xls/tests/trial_balance.yml b/account_financial_report_webkit_xls/tests/trial_balance.yml new file mode 100644 index 00000000..661eb47d --- /dev/null +++ b/account_financial_report_webkit_xls/tests/trial_balance.yml @@ -0,0 +1,67 @@ +- + In order to test the Excel Trial Balance webkit wizard I will print report with default setting +- + !python {model: account.account}: | + from datetime import datetime + ctx={'xls_export':1} + data_dict = {'chart_account_id':ref('account.chart0')} + from openerp.tools import test_reports + test_reports.try_report_action(cr, uid, 'account_financial_report_webkit.action_account_trial_balance_menu_webkit',wiz_data=data_dict, wiz_buttons='xls_export', context=ctx, our_module='') + +- + In order to test the Excel Trial Balance webkit wizard I will print report as if we print it from an account +- + !python {model: account.account}: | + from datetime import datetime + ctx={'xls_export':1} + data_dict = {'chart_account_id':ref('account.chart0')} + ctx.update({'model': 'account.account','active_ids':[ref('account.assets_view'), ref('account.liabilities_view')],'active_id': ref('account.assets_view')}) + from openerp.tools import test_reports + test_reports.try_report_action(cr, uid, 'account_financial_report_webkit.action_account_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, wiz_buttons='xls_export', our_module='account_financial_report_webkit_xls') + +- + In order to test the Excel Trial Balance webkit wizard I will print report with filters on period +- + !python {model: account.account}: | + from datetime import datetime + ctx={'xls_export':1} + data_dict = {'chart_account_id':ref('account.chart0'), 'fiscalyear_id': ref('account.data_fiscalyear'), + 'filter': 'filter_period', 'period_from': ref('account.period_1'), 'period_to': ref('account.period_12')} + from openerp.tools import test_reports + test_reports.try_report_action(cr, uid, 'account_financial_report_webkit.action_account_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, wiz_buttons='xls_export', our_module='account_financial_report_webkit_xls') + +- + In order to test the Excel Trial Balance webkit wizard I will print report with filters on dates +- + !python {model: account.account}: | + from datetime import datetime + ctx={'xls_export':1} + data_dict = {'chart_account_id':ref('account.chart0'), 'fiscalyear_id': ref('account.data_fiscalyear'), + 'filter': 'filter_date', 'date_from': '%s-01-01' %(datetime.now().year), 'date_to': '%s-12-31' %(datetime.now().year)} + from openerp.tools import test_reports + test_reports.try_report_action(cr, uid, 'account_financial_report_webkit.action_account_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, wiz_buttons='xls_export', our_module='account_financial_report_webkit_xls') + +- + In order to test the Excel Trial Balance webkit wizard I will print report with one comparison filtered by year +- + !python {model: account.account}: | + from datetime import datetime + ctx={'xls_export':1} + data_dict = {'chart_account_id':ref('account.chart0'), 'fiscalyear_id': ref('account.data_fiscalyear'), + 'comp0_filter': 'filter_year', 'comp0_fiscalyear_id': ref('account.data_fiscalyear')} + from openerp.tools import test_reports + test_reports.try_report_action(cr, uid, 'account_financial_report_webkit.action_account_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, wiz_buttons='xls_export', our_module='account_financial_report_webkit_xls') + +- + In order to test the Excel Trial Balance webkit wizard I will print report with all comparisons filtered by year, period and date +- + !python {model: account.account}: | + from datetime import datetime + ctx={'xls_export':1} + data_dict = {'chart_account_id':ref('account.chart0'), 'fiscalyear_id': ref('account.data_fiscalyear'), + 'comp0_filter': 'filter_year', 'comp0_fiscalyear_id': ref('account.data_fiscalyear'), + 'comp1_filter': 'filter_period', 'comp1_period_from': ref('account.period_1'), 'comp1_period_to': ref('account.period_12'), + 'comp2_filter': 'filter_date', 'comp2_date_from': '%s-01-01' %(datetime.now().year), 'comp2_date_to': '%s-12-31' %(datetime.now().year) + } + from openerp.tools import test_reports + test_reports.try_report_action(cr, uid, 'account_financial_report_webkit.action_account_trial_balance_menu_webkit',wiz_data=data_dict, context=ctx, wiz_buttons='xls_export', our_module='account_financial_report_webkit_xls')