diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py index b08fec5835b..3f8735d3ab1 100644 --- a/addons/account/__terp__.py +++ b/addons/account/__terp__.py @@ -58,7 +58,8 @@ module named account_voucherss 'wizard/account_move_line_unreconcile_select_view.xml', 'wizard/account_vat_view.xml', 'wizard/account_print_journal_view.xml', - + 'wizard/account_general_journal_view.xml', + 'wizard/account_central_journal_view.xml', 'wizard/account_subscription_generate_view.xml', 'project/wizard/project_account_analytic_line_view.xml', 'account_view.xml', diff --git a/addons/account/account_wizard.xml b/addons/account/account_wizard.xml index 0a72815d175..fc2859f08d0 100644 --- a/addons/account/account_wizard.xml +++ b/addons/account/account_wizard.xml @@ -112,13 +112,13 @@ + - + --> diff --git a/addons/account/report/central_journal.py b/addons/account/report/central_journal.py index 9bc2cfdd1b9..36c61b877ff 100644 --- a/addons/account/report/central_journal.py +++ b/addons/account/report/central_journal.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -59,8 +59,8 @@ class journal_print(report_sxw.rml_parse): def _sum_credit(self, period_id, journal_id): self.cr.execute('select sum(credit) from account_move_line where period_id=%s and journal_id=%s and state<>\'draft\'', (period_id, journal_id)) return self.cr.fetchone()[0] or 0.0 -report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml',parser=journal_print, header=False) -report_sxw.report_sxw('report.account.central.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_central_journal.rml',parser=journal_print, header=False) +report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml', parser=journal_print, header=False) +report_sxw.report_sxw('report.account.central.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_central_journal.rml', parser=journal_print, header=False) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/general_journal.py b/addons/account/report/general_journal.py index 2da07e04cfd..112ce970694 100644 --- a/addons/account/report/general_journal.py +++ b/addons/account/report/general_journal.py @@ -122,8 +122,8 @@ class journal_print(report_sxw.rml_parse): return 0.0 self.cr.execute('select sum(credit) from account_move_line where period_id =ANY(%s) and journal_id =ANY(%s) and state<>\'draft\'',(self.period_ids,self.journal_ids,)) return self.cr.fetchone()[0] or 0.0 -report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml',parser=journal_print) -report_sxw.report_sxw('report.account.general.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_general_journal.rml',parser=journal_print, header=False) +report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml', parser=journal_print) +report_sxw.report_sxw('report.account.general.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_general_journal.rml', parser=journal_print, header=False) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py index 37aa1672823..18a8c2a9f2b 100644 --- a/addons/account/wizard/__init__.py +++ b/addons/account/wizard/__init__.py @@ -54,8 +54,8 @@ import wizard_state_open import wizard_statement_from_invoice import account_print_journal -import wizard_central_journal -import wizard_general_journal +import account_central_journal +import account_general_journal import wizard_change_currency # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_central_journal.py b/addons/account/wizard/account_central_journal.py new file mode 100644 index 00000000000..7e93a30c227 --- /dev/null +++ b/addons/account/wizard/account_central_journal.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import osv, fields + +class account_central_journal(osv.osv_memory): + _name = 'account.central.journal' + _description = 'Account Central Journal' + + _columns = { + 'journal_id': fields.many2many('account.journal', 'account_journal_rel', 'account_id', 'journal_id', 'Journals', required=True), + 'period_id': fields.many2many('account.period', 'account_period_rel', 'account_id', 'period_id', 'Periods', required=True), + } + + def check_data(self, cr, uid, ids, context={}): + obj_jperiod = self.pool.get('account.journal.period') + datas = {} + datas['ids'] = [] + datas['model'] = 'account.journal.period' + datas['form'] = self.read(cr, uid, ids)[0] + period_id = datas['form']['period_id'] + journal_id = datas['form']['journal_id'] + + if type(period_id)==type([]): + ids_final = [] + for journal in journal_id: + for period in period_id: + ids_journal_period = obj_jperiod.search(cr,uid, [('journal_id','=',journal),('period_id','=',period)], context=context) + if ids_journal_period: + ids_final.append(ids_journal_period) + if not ids_final: + raise osv.except_osv(_('No Data Available'), _('No records found for your selection!')) + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'account.central.journal', + 'datas': datas, + } + +account_central_journal() + +#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + + diff --git a/addons/account/wizard/account_central_journal_view.xml b/addons/account/wizard/account_central_journal_view.xml new file mode 100644 index 00000000000..ec3f0eabb5d --- /dev/null +++ b/addons/account/wizard/account_central_journal_view.xml @@ -0,0 +1,41 @@ + + + + + + Account central Journal + account.central.journal + form + +
+ + + + + + +