diff --git a/account_journal_report_xls/README.rst b/account_journal_report_xls/README.rst new file mode 100644 index 00000000..94b8b750 --- /dev/null +++ b/account_journal_report_xls/README.rst @@ -0,0 +1,14 @@ +Journal Reports +=============== + +This module adds journal reports by period and by fiscal year with + +* entries printed per move +* option to group entries with same general account & VAT case +* vat info per entry +* vat summary + +These reports are available in PDF and XLS format. + +This module depends upon the 'report_xls' module, +cf. https://github.com/OCA/reporting-engine diff --git a/__unported__/account_journal_report_xls/__init__.py b/account_journal_report_xls/__init__.py similarity index 100% rename from __unported__/account_journal_report_xls/__init__.py rename to account_journal_report_xls/__init__.py diff --git a/__unported__/account_journal_report_xls/__openerp__.py b/account_journal_report_xls/__openerp__.py similarity index 75% rename from __unported__/account_journal_report_xls/__openerp__.py rename to account_journal_report_xls/__openerp__.py index cac29015..dcd88583 100644 --- a/__unported__/account_journal_report_xls/__openerp__.py +++ b/account_journal_report_xls/__openerp__.py @@ -26,23 +26,6 @@ 'license': 'AGPL-3', 'author': 'Noviat', 'category': 'Accounting & Finance', - 'description': """ - -Journal Reports -=============== - -This module adds journal reports by period and by fiscal year with - - entries printed per move - - option to group entries with same general account & VAT case - - vat info per entry - - vat summary - -These reports are available in PDF and XLS format. - -This module depends upon the 'report_xls' module, -cf. https://launchpad.net/openerp-reporting-engines - - """, 'depends': [ 'account_voucher', 'report_xls', @@ -51,4 +34,11 @@ cf. https://launchpad.net/openerp-reporting-engines 'data': [ 'wizard/print_journal_wizard.xml', ], + 'test': [ + 'tests/print_journal_by_fiscal_year.yml', + 'tests/print_journal_by_period.yml', + 'tests/export_csv_journal_by_fiscal_year.yml', + 'tests/export_csv_journal_by_period.yml', + ], + 'installable': True, } diff --git a/__unported__/account_journal_report_xls/account_journal.py b/account_journal_report_xls/account_journal.py similarity index 100% rename from __unported__/account_journal_report_xls/account_journal.py rename to account_journal_report_xls/account_journal.py diff --git a/account_journal_report_xls/i18n/account_journal_report_xls.pot b/account_journal_report_xls/i18n/account_journal_report_xls.pot new file mode 100644 index 00000000..24ddae8b --- /dev/null +++ b/account_journal_report_xls/i18n/account_journal_report_xls.pot @@ -0,0 +1,309 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_journal_report_xls +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-11-19 13:34+0000\n" +"PO-Revision-Date: 2014-11-19 13:34+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_journal_report_xls +#: selection:account.print.journal.xls,target_move:0 +msgid "All Entries" +msgstr "" + +#. module: account_journal_report_xls +#: selection:account.print.journal.xls,target_move:0 +msgid "All Posted Entries" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/report/nov_account_journal.py:97 +#, python-format +msgid "Amount" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,chart_account_id:0 +msgid "Chart of Account" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,company_id:0 +msgid "Company" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,create_uid:0 +msgid "Created by" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,create_date:0 +msgid "Created on" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/report/nov_account_journal.py:98 +#, python-format +msgid "Credit" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/report/nov_account_journal.py:97 +#, python-format +msgid "Currency" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/report/nov_account_journal_xls.py:381 +#, python-format +msgid "Customisation Error!" +msgstr "" + +#. module: account_journal_report_xls +#: selection:account.print.journal.xls,filter:0 +#: selection:account.print.journal.xls,sort_selection:0 +msgid "Date" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/report/nov_account_journal.py:98 +#, python-format +msgid "Debit" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,date_to:0 +msgid "End Date" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,period_to:0 +msgid "End Period" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,sort_selection:0 +msgid "Entries Sorted by" +msgstr "" + +#. module: account_journal_report_xls +#: view:account.print.journal.xls:account_journal_report_xls.view_print_journal_xls +msgid "Export" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,filter:0 +msgid "Filter by" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,fiscalyear_id:0 +#: code:addons/account_journal_report_xls/report/nov_account_journal.py:93 +#, python-format +msgid "Fiscal Year" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,group_entries:0 +msgid "Group Entries" +msgstr "" + +#. module: account_journal_report_xls +#: help:account.print.journal.xls,group_entries:0 +msgid "Group entries with same General Account & Tax Code." +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/report/nov_account_journal.py:270 +#, python-format +msgid "Grouped Entries" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,id:0 +msgid "ID" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/report/nov_account_journal.py:209 +#, python-format +msgid "Invoice" +msgstr "" + +#. module: account_journal_report_xls +#: model:ir.model,name:account_journal_report_xls.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_journal_report_xls +#: selection:account.print.journal.xls,sort_selection:0 +msgid "Journal Entry Number" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/report/nov_account_journal_xls.py:244 +#, python-format +msgid "Journal Overview" +msgstr "" + +#. module: account_journal_report_xls +#: model:ir.actions.act_window,name:account_journal_report_xls.action_print_journal_by_fiscalyear_xls +#: model:ir.ui.menu,name:account_journal_report_xls.menu_print_journal_by_fiscalyear_xls +msgid "Journal by Fiscal Year" +msgstr "" + +#. module: account_journal_report_xls +#: model:ir.actions.act_window,name:account_journal_report_xls.action_print_journal_by_period_xls +#: model:ir.ui.menu,name:account_journal_report_xls.menu_print_journal_by_period_xls +msgid "Journal by Period" +msgstr "" + +#. module: account_journal_report_xls +#: view:account.print.journal.xls:account_journal_report_xls.view_print_journal_xls +#: field:account.print.journal.xls,journal_ids:0 +msgid "Journals" +msgstr "" + +#. module: account_journal_report_xls +#: help:account.print.journal.xls,fiscalyear_id:0 +msgid "Keep empty for all open fiscal year" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,write_uid:0 +msgid "Last Updated by" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,write_date:0 +msgid "Last Updated on" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/wizard/print_journal_wizard.py:160 +#: code:addons/account_journal_report_xls/wizard/print_journal_wizard.py:184 +#, python-format +msgid "No Data Available" +msgstr "" + +#. module: account_journal_report_xls +#: selection:account.print.journal.xls,filter:0 +msgid "No Filters" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/wizard/print_journal_wizard.py:161 +#: code:addons/account_journal_report_xls/wizard/print_journal_wizard.py:185 +#, python-format +msgid "No records found for your selection!" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/report/nov_account_journal.py:92 +#, python-format +msgid "Period" +msgstr "" + +#. module: account_journal_report_xls +#: view:account.print.journal.xls:account_journal_report_xls.view_print_journal_xls +#: selection:account.print.journal.xls,filter:0 +msgid "Periods" +msgstr "" + +#. module: account_journal_report_xls +#: view:account.print.journal.xls:account_journal_report_xls.view_print_journal_xls +msgid "Print" +msgstr "" + +#. module: account_journal_report_xls +#: help:account.print.journal.xls,amount_currency:0 +msgid "Print Report with the currency column if the currency differs from the company currency." +msgstr "" + +#. module: account_journal_report_xls +#: model:ir.model,name:account_journal_report_xls.model_account_print_journal_xls +msgid "Print/Export Journal" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/report/nov_account_journal_xls.py:327 +#, python-format +msgid "Programming Error!" +msgstr "" + +#. module: account_journal_report_xls +#: help:account.print.journal.xls,chart_account_id:0 +msgid "Select Charts of Accounts" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,date_from:0 +msgid "Start Date" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,period_from:0 +msgid "Start Period" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/report/nov_account_journal.py:213 +#, python-format +msgid "Statement" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,target_move:0 +msgid "Target Moves" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/report/nov_account_journal_xls.py:382 +#, python-format +msgid "The 'Balance' field is a calculated XLS field requiring the presence of the 'Debit' and 'Credit' fields !" +msgstr "" + +#. module: account_journal_report_xls +#: view:account.print.journal.xls:account_journal_report_xls.view_print_journal_xls +msgid "This report allows you to generate a pdf or xls of your journals" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/report/nov_account_journal_xls.py:314 +#, python-format +msgid "VAT Declaration" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/report/nov_account_journal.py:210 +#: code:addons/account_journal_report_xls/report/nov_account_journal.py:214 +#, python-format +msgid "Voucher" +msgstr "" + +#. module: account_journal_report_xls +#: field:account.print.journal.xls,amount_currency:0 +msgid "With Currency" +msgstr "" + +#. module: account_journal_report_xls +#: view:account.print.journal.xls:account_journal_report_xls.view_print_journal_xls +msgid "onchange_fiscalyear_id(fiscalyear_id, context)" +msgstr "" + +#. module: account_journal_report_xls +#: code:addons/account_journal_report_xls/report/nov_account_journal_xls.py:328 +#, python-format +msgid "vat_summary_cols_number should be < cols_number !" +msgstr "" + diff --git a/__unported__/account_journal_report_xls/i18n/fr.po b/account_journal_report_xls/i18n/fr.po similarity index 100% rename from __unported__/account_journal_report_xls/i18n/fr.po rename to account_journal_report_xls/i18n/fr.po diff --git a/__unported__/account_journal_report_xls/i18n/nl.po b/account_journal_report_xls/i18n/nl.po similarity index 100% rename from __unported__/account_journal_report_xls/i18n/nl.po rename to account_journal_report_xls/i18n/nl.po diff --git a/__unported__/account_journal_report_xls/report/__init__.py b/account_journal_report_xls/report/__init__.py similarity index 100% rename from __unported__/account_journal_report_xls/report/__init__.py rename to account_journal_report_xls/report/__init__.py diff --git a/__unported__/account_journal_report_xls/report/nov_account_journal.py b/account_journal_report_xls/report/nov_account_journal.py similarity index 100% rename from __unported__/account_journal_report_xls/report/nov_account_journal.py rename to account_journal_report_xls/report/nov_account_journal.py diff --git a/__unported__/account_journal_report_xls/report/nov_account_journal.rml b/account_journal_report_xls/report/nov_account_journal.rml similarity index 100% rename from __unported__/account_journal_report_xls/report/nov_account_journal.rml rename to account_journal_report_xls/report/nov_account_journal.rml diff --git a/__unported__/account_journal_report_xls/report/nov_account_journal_xls.py b/account_journal_report_xls/report/nov_account_journal_xls.py similarity index 98% rename from __unported__/account_journal_report_xls/report/nov_account_journal_xls.py rename to account_journal_report_xls/report/nov_account_journal_xls.py index 57cdcd40..75fe9215 100644 --- a/__unported__/account_journal_report_xls/report/nov_account_journal_xls.py +++ b/account_journal_report_xls/report/nov_account_journal_xls.py @@ -235,7 +235,7 @@ class account_journal_xls(report_xls): self.aml_cell_style_decimal]}, } - def _journal_title(self, o, ws, _p, row_pos, xlwt, _xs): + def _journal_title(self, o, ws, _p, row_pos, _xs): cell_style = xlwt.easyxf(_xs['xls_title']) report_name = (10 * ' ').join([ _p.company.name, @@ -251,7 +251,7 @@ class account_journal_xls(report_xls): ws, row_pos, row_data, row_style=cell_style) return row_pos + 1 - def _journal_lines(self, o, ws, _p, row_pos, xlwt, _xs): + def _journal_lines(self, o, ws, _p, row_pos, _xs): wanted_list = self.wanted_list debit_pos = self.debit_pos @@ -305,7 +305,7 @@ class account_journal_xls(report_xls): ws, row_pos, row_data, row_style=self.rt_cell_style_right) return row_pos + 1 - def _journal_vat_summary(self, o, ws, _p, row_pos, xlwt, _xs): + def _journal_vat_summary(self, o, ws, _p, row_pos, _xs): if not _p.tax_codes(o): return row_pos @@ -400,9 +400,9 @@ class account_journal_xls(report_xls): ws.footer_str = self.xls_footers['standard'] # Data - row_pos = self._journal_title(o, ws, _p, row_pos, xlwt, _xs) - row_pos = self._journal_lines(o, ws, _p, row_pos, xlwt, _xs) - row_pos = self._journal_vat_summary(o, ws, _p, row_pos, xlwt, _xs) + row_pos = self._journal_title(o, ws, _p, row_pos, _xs) + row_pos = self._journal_lines(o, ws, _p, row_pos, _xs) + row_pos = self._journal_vat_summary(o, ws, _p, row_pos, _xs) account_journal_xls('report.nov.account.journal.xls', 'account.journal.period', parser=account_journal_xls_parser) diff --git a/__unported__/account_journal_report_xls/static/src/img/icon.png b/account_journal_report_xls/static/src/img/icon.png similarity index 100% rename from __unported__/account_journal_report_xls/static/src/img/icon.png rename to account_journal_report_xls/static/src/img/icon.png diff --git a/account_journal_report_xls/tests/export_csv_journal_by_fiscal_year.yml b/account_journal_report_xls/tests/export_csv_journal_by_fiscal_year.yml new file mode 100644 index 00000000..0275c402 --- /dev/null +++ b/account_journal_report_xls/tests/export_csv_journal_by_fiscal_year.yml @@ -0,0 +1,83 @@ +- + In order to test the Excel General Ledger webkit wizard I will print report on all the journals +- + !python {model: account.account}: | + ctx = {} + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_fiscalyear_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='xls_export', + our_module='account_journal_report_xls') + +- + In order to test the Excel General Ledger webkit wizard I will print report with entries sorted by date +- + !python {model: account.account}: | + ctx = {} + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + 'sort_selection': 'l.date', + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_fiscalyear_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='xls_export', + our_module='account_journal_report_xls') + +- + In order to test the Excel General Ledger webkit wizard I will print report without grouped entries +- + !python {model: account.account}: | + ctx = {} + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + 'group_entries': False, + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_fiscalyear_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='xls_export', + our_module='account_journal_report_xls') + +- + In order to test the Excel General Ledger webkit wizard I will print report with currency +- + !python {model: account.account}: | + ctx = {} + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + 'amount_currency': False, + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_fiscalyear_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='xls_export', + our_module='account_journal_report_xls') + diff --git a/account_journal_report_xls/tests/export_csv_journal_by_period.yml b/account_journal_report_xls/tests/export_csv_journal_by_period.yml new file mode 100644 index 00000000..bc2e0f07 --- /dev/null +++ b/account_journal_report_xls/tests/export_csv_journal_by_period.yml @@ -0,0 +1,107 @@ +- + In order to test the Excel General Ledger webkit wizard I will print report on all the journals +- + !python {model: account.account}: | + ctx = {} + fiscalyear_id = self.pool['account.fiscalyear'].search(cr, uid, [])[0] + wizard = self.pool['account.print.journal.xls'] + period_ids = wizard.fy_period_ids(cr, uid, fiscalyear_id) + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + 'fiscalyear_id': fiscalyear_id, + 'period_from': period_ids[0], + 'period_to': period_ids[-1], + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_period_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='xls_export', + our_module='account_journal_report_xls') + +- + In order to test the Excel General Ledger webkit wizard I will print report with entries sorted by date +- + !python {model: account.account}: | + ctx = {} + fiscalyear_id = self.pool['account.fiscalyear'].search(cr, uid, [])[0] + wizard = self.pool['account.print.journal.xls'] + period_ids = wizard.fy_period_ids(cr, uid, fiscalyear_id) + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + 'sort_selection': 'l.date', + 'fiscalyear_id': fiscalyear_id, + 'period_from': period_ids[0], + 'period_to': period_ids[-1], + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_period_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='xls_export', + our_module='account_journal_report_xls') + +- + In order to test the Excel General Ledger webkit wizard I will print report without grouped entries +- + !python {model: account.account}: | + ctx = {} + fiscalyear_id = self.pool['account.fiscalyear'].search(cr, uid, [])[0] + wizard = self.pool['account.print.journal.xls'] + period_ids = wizard.fy_period_ids(cr, uid, fiscalyear_id) + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + 'group_entries': False, + 'fiscalyear_id': fiscalyear_id, + 'period_from': period_ids[0], + 'period_to': period_ids[-1], + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_period_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='xls_export', + our_module='account_journal_report_xls') + +- + In order to test the Excel General Ledger webkit wizard I will print report with currency +- + !python {model: account.account}: | + ctx = {} + fiscalyear_id = self.pool['account.fiscalyear'].search(cr, uid, [])[0] + wizard = self.pool['account.print.journal.xls'] + period_ids = wizard.fy_period_ids(cr, uid, fiscalyear_id) + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + 'amount_currency': False, + 'fiscalyear_id': fiscalyear_id, + 'period_from': period_ids[0], + 'period_to': period_ids[-1], + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_period_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='xls_export', + our_module='account_journal_report_xls') + diff --git a/account_journal_report_xls/tests/print_journal_by_fiscal_year.yml b/account_journal_report_xls/tests/print_journal_by_fiscal_year.yml new file mode 100644 index 00000000..27d6826f --- /dev/null +++ b/account_journal_report_xls/tests/print_journal_by_fiscal_year.yml @@ -0,0 +1,83 @@ +- + In order to test the Excel General Ledger webkit wizard I will print report on all the journals +- + !python {model: account.account}: | + ctx = {} + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_fiscalyear_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='print_report', + our_module='account_journal_report_xls') + +- + In order to test the Excel General Ledger webkit wizard I will print report with entries sorted by date +- + !python {model: account.account}: | + ctx = {} + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + 'sort_selection': 'l.date', + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_fiscalyear_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='print_report', + our_module='account_journal_report_xls') + +- + In order to test the Excel General Ledger webkit wizard I will print report without grouped entries +- + !python {model: account.account}: | + ctx = {} + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + 'group_entries': False, + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_fiscalyear_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='print_report', + our_module='account_journal_report_xls') + +- + In order to test the Excel General Ledger webkit wizard I will print report with currency +- + !python {model: account.account}: | + ctx = {} + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + 'amount_currency': False, + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_fiscalyear_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='print_report', + our_module='account_journal_report_xls') + diff --git a/account_journal_report_xls/tests/print_journal_by_period.yml b/account_journal_report_xls/tests/print_journal_by_period.yml new file mode 100644 index 00000000..eb36060c --- /dev/null +++ b/account_journal_report_xls/tests/print_journal_by_period.yml @@ -0,0 +1,107 @@ +- + In order to test the Excel General Ledger webkit wizard I will print report on all the journals +- + !python {model: account.account}: | + ctx = {} + fiscalyear_id = self.pool['account.fiscalyear'].search(cr, uid, [])[0] + wizard = self.pool['account.print.journal.xls'] + period_ids = wizard.fy_period_ids(cr, uid, fiscalyear_id) + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + 'fiscalyear_id': fiscalyear_id, + 'period_from': period_ids[0], + 'period_to': period_ids[-1], + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_period_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='print_report', + our_module='account_journal_report_xls') + +- + In order to test the Excel General Ledger webkit wizard I will print report with entries sorted by date +- + !python {model: account.account}: | + ctx = {} + fiscalyear_id = self.pool['account.fiscalyear'].search(cr, uid, [])[0] + wizard = self.pool['account.print.journal.xls'] + period_ids = wizard.fy_period_ids(cr, uid, fiscalyear_id) + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + 'sort_selection': 'l.date', + 'fiscalyear_id': fiscalyear_id, + 'period_from': period_ids[0], + 'period_to': period_ids[-1], + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_period_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='print_report', + our_module='account_journal_report_xls') + +- + In order to test the Excel General Ledger webkit wizard I will print report without grouped entries +- + !python {model: account.account}: | + ctx = {} + fiscalyear_id = self.pool['account.fiscalyear'].search(cr, uid, [])[0] + wizard = self.pool['account.print.journal.xls'] + period_ids = wizard.fy_period_ids(cr, uid, fiscalyear_id) + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + 'group_entries': False, + 'fiscalyear_id': fiscalyear_id, + 'period_from': period_ids[0], + 'period_to': period_ids[-1], + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_period_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='print_report', + our_module='account_journal_report_xls') + +- + In order to test the Excel General Ledger webkit wizard I will print report with currency +- + !python {model: account.account}: | + ctx = {} + fiscalyear_id = self.pool['account.fiscalyear'].search(cr, uid, [])[0] + wizard = self.pool['account.print.journal.xls'] + period_ids = wizard.fy_period_ids(cr, uid, fiscalyear_id) + data_dict = {'chart_account_id': ref('account.chart0'), + 'journal_ids': self.pool['account.journal'].search(cr, uid, []), + 'amount_currency': False, + 'fiscalyear_id': fiscalyear_id, + 'period_from': period_ids[0], + 'period_to': period_ids[-1], + } + ctx.update({'model': 'account.account', + 'active_ids': [ref('account.chart0')], + 'active_id': ref('account.chart0')}) + from openerp.tools import test_reports + test_reports.try_report_action( + cr, uid, + 'account_journal_report_xls.action_print_journal_by_period_xls', + wiz_data=data_dict, + context=ctx, + wiz_buttons='print_report', + our_module='account_journal_report_xls') + diff --git a/__unported__/account_journal_report_xls/wizard/__init__.py b/account_journal_report_xls/wizard/__init__.py similarity index 100% rename from __unported__/account_journal_report_xls/wizard/__init__.py rename to account_journal_report_xls/wizard/__init__.py diff --git a/__unported__/account_journal_report_xls/wizard/print_journal_wizard.py b/account_journal_report_xls/wizard/print_journal_wizard.py similarity index 97% rename from __unported__/account_journal_report_xls/wizard/print_journal_wizard.py rename to account_journal_report_xls/wizard/print_journal_wizard.py index 6c4f9df7..cc2ab4a2 100644 --- a/__unported__/account_journal_report_xls/wizard/print_journal_wizard.py +++ b/account_journal_report_xls/wizard/print_journal_wizard.py @@ -33,8 +33,13 @@ class account_print_journal_xls(orm.TransientModel): _name = 'account.print.journal.xls' _description = 'Print/Export Journal' _columns = { - 'journal_ids': fields.many2many('account.journal', string='Journals', - required=True), + 'journal_ids': fields.many2many( + 'account.journal', + 'account_print_journal_xls_journal_rel', + 'journal_xls_id', + 'journal_id', + string='Journals', + required=True), 'group_entries': fields.boolean( 'Group Entries', help="Group entries with same General Account & Tax Code."), diff --git a/__unported__/account_journal_report_xls/wizard/print_journal_wizard.xml b/account_journal_report_xls/wizard/print_journal_wizard.xml similarity index 100% rename from __unported__/account_journal_report_xls/wizard/print_journal_wizard.xml rename to account_journal_report_xls/wizard/print_journal_wizard.xml