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
+
+
+
+
+
+
+ Account Central Journal
+ ir.actions.act_window
+ account.central.journal
+ form
+ form
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/wizard/account_general_journal.py b/addons/account/wizard/account_general_journal.py
new file mode 100644
index 00000000000..0f86f52f5aa
--- /dev/null
+++ b/addons/account/wizard/account_general_journal.py
@@ -0,0 +1,59 @@
+# -*- 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_general_journal(osv.osv_memory):
+ _name = 'account.general.journal'
+ _description = 'Account General 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.general.journal',
+ 'datas': datas,
+ }
+
+account_general_journal()
+
+#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_general_journal_view.xml b/addons/account/wizard/account_general_journal_view.xml
new file mode 100644
index 00000000000..425efbaf847
--- /dev/null
+++ b/addons/account/wizard/account_general_journal_view.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+ Account Genral Journal
+ account.general.journal
+ form
+
+
+
+
+
+
+ Account General Journal
+ ir.actions.act_window
+ account.general.journal
+ form
+ form
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/wizard/wizard_central_journal.py b/addons/account/wizard/wizard_central_journal.py
deleted file mode 100644
index 32fb02f3230..00000000000
--- a/addons/account/wizard/wizard_central_journal.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# -*- 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 .
-#
-##############################################################################
-
-import wizard
-import pooler
-from tools.translate import _
-
-form = '''
-'''
-
-fields = {
- 'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
- 'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
-}
-
-
-def _check_data(self, cr, uid, data, *args):
- period_id = data['form']['period_id'][0][2]
- journal_id=data['form']['journal_id'][0][2]
-
- if type(period_id)==type([]):
-
- ids_final = []
-
- for journal in journal_id:
- for period in period_id:
- ids_journal_period = pooler.get_pool(cr.dbname).get('account.journal.period').search(cr,uid, [('journal_id','=',journal),('period_id','=',period)])
-
- if ids_journal_period:
- ids_final.append(ids_journal_period)
-
- if not ids_final:
- raise wizard.except_wizard(_('No Data Available'), _('No records found for your selection!'))
- return data['form']
-
-
-class wizard_print_journal(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel', 'gtk-cancel'), ('print', 'Print', 'gtk-ok'))},
- },
- 'print': {
- 'actions': [_check_data],
- 'result': {'type':'print', 'report':'account.central.journal.wiz', 'state':'end'},
- },
- }
-wizard_print_journal('account.central.journal.report')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account/wizard/wizard_general_journal.py b/addons/account/wizard/wizard_general_journal.py
deleted file mode 100644
index 26935aa80d6..00000000000
--- a/addons/account/wizard/wizard_general_journal.py
+++ /dev/null
@@ -1,70 +0,0 @@
-# -*- 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 .
-#
-##############################################################################
-
-import wizard
-import pooler
-from tools.translate import _
-
-form = '''
-'''
-
-fields = {
- 'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
- 'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
-}
-
-def _check_data(self, cr, uid, data, *args):
- period_id = data['form']['period_id'][0][2]
- journal_id=data['form']['journal_id'][0][2]
-
- if type(period_id)==type([]):
-
- ids_final = []
-
- for journal in journal_id:
- for period in period_id:
- ids_journal_period = pooler.get_pool(cr.dbname).get('account.journal.period').search(cr,uid, [('journal_id','=',journal),('period_id','=',period)])
-
- if ids_journal_period:
- ids_final.append(ids_journal_period)
-
- if not ids_final:
- raise wizard.except_wizard(_('No Data Available'), _('No records found for your selection!'))
- return data['form']
-
-class wizard_print_journal(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel', 'gtk-cancel'), ('print', 'Print', 'gtk-ok'))},
- },
- 'print': {
- 'actions': [_check_data],
- 'result': {'type':'print', 'report':'account.general.journal.wiz', 'state':'end'},
- },
- }
-wizard_print_journal('account.general.journal.report')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-