diff --git a/addons/account/wizard/account_common_report.xml b/addons/account/wizard/account_common_report.xml index 4f2fecabd9a..72263e12046 100644 --- a/addons/account/wizard/account_common_report.xml +++ b/addons/account/wizard/account_common_report.xml @@ -8,7 +8,6 @@
- diff --git a/addons/account/wizard/account_report_general_ledger.py b/addons/account/wizard/account_report_general_ledger.py new file mode 100644 index 00000000000..a7bd64e88a0 --- /dev/null +++ b/addons/account/wizard/account_report_general_ledger.py @@ -0,0 +1,71 @@ +# -*- 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 time + +from osv import fields, osv +from tools.translate import _ +import tools + +class account_report_general_ledger(osv.osv_memory): + _inherit = "account.common.report" + _name = "account.report.general.ledger" + _description = "General Ledger Report" + + _columns = { + 'display_account': fields.selection([('bal_mouvement','With movements'), ('bal_all','All'), ('bal_solde','With balance is not equal to 0')],"Display accounts"), + 'landscape': fields.boolean("Landscape Mode"), + 'soldeinit': fields.boolean("Include initial balances"), + 'amount_currency': fields.boolean("With Currency"), + #'state': fields.selection([('bydate','By Date'), ('byperiod','By Period'), ('all','By Date and Period'), ('none','No Filter')],"Date/Period Filter"), + } + + _defaults = { + 'display_account' : 'bal_all', + 'landscape': True, + 'amount_currency' : True, + } + + def check_report(self, cr, uid, ids, context=None): + if context is None: + context = {} + data={} + data['ids'] = context.get('active_ids',[]) + data['form'] = self.read(cr, uid, ids, )[0] + data['form']['Account_list'] = context.get('Account_list',[]) + if data['form']['Account_list']: + data['model'] = 'ir.ui.menu' + else: + data['model'] = 'account.account' + data['form']['context'] = context + if data['form']['state'] == 'bydate': + return self._check_date(cr, uid, data, context) + elif data['form']['state'] == 'byperiod': + if not data['form']['periods']: + raise osv.except_osv(_('Data Insufficient !'),_('Please select periods.')) + if data['form']['landscape'] == True: + return { 'type': 'ir.actions.report.xml', 'report_name': 'account.general.ledger_landscape', 'datas': data, 'nodestroy':True, } + else: + return { 'type': 'ir.actions.report.xml', 'report_name': 'account.general.ledger', 'datas': data, 'nodestroy':True, } + + +account_general_ledger_report() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_report_general_ledger_view.xml b/addons/account/wizard/account_report_general_ledger_view.xml new file mode 100644 index 00000000000..a2ff3accf5f --- /dev/null +++ b/addons/account/wizard/account_report_general_ledger_view.xml @@ -0,0 +1,102 @@ + + + + + + General Ledger + account.general.ledger.report + form + + + + + +