Saurang Suthar(OpenERP) has proposed merging lp:~openerp-dev/openerp-india/trunk-report-general-ledger-account_general_ledger_improvement-ssu into lp:~openerp-dev/openerp-india/trunk-report-general-ledger.
Requested reviews: Saurang Suthar(OpenERP) (ssu-openerp) Mustufa Rangwala (Open ERP) (mra-tinyerp) For more details, see: https://code.launchpad.net/~openerp-dev/openerp-india/trunk-report-general-ledger-account_general_ledger_improvement-ssu/+merge/107974 Hello sir, improved code by removing unnecessary import file. Thank you. Saurang - ssu -- https://code.launchpad.net/~openerp-dev/openerp-india/trunk-report-general-ledger-account_general_ledger_improvement-ssu/+merge/107974 Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openerp-india/trunk-report-general-ledger.
=== added directory 'account_general_ledger' === added file 'account_general_ledger/__init__.py' --- account_general_ledger/__init__.py 1970-01-01 00:00:00 +0000 +++ account_general_ledger/__init__.py 2012-06-01 09:27:22 +0000 @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# 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 <http://www.gnu.org/licenses/>. +# +############################################################################## + +import wizard +import report + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: === added file 'account_general_ledger/__openerp__.py' --- account_general_ledger/__openerp__.py 1970-01-01 00:00:00 +0000 +++ account_general_ledger/__openerp__.py 2012-06-01 09:27:22 +0000 @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# 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 <http://www.gnu.org/licenses/>. +# +############################################################################## +{ + "name" : "Account General Ledger", + "version" : "1.1", + "author" : "OpenERP SA", + "category": 'Accounting & Finance', + 'complexity': "easy", + "description": """ +Account General Ledger. +==================================== +This module is used for managing the ledger reports of different accounts. It manages the generation of reports of +different accounts on the basis of the entries in those accounts. The reports can be also generated either in +landscape mode or without landscape mode. It also helps to reports either by filtering or without filtering. +If user wants to print reports using filter then the filtering of accounts can be done by date and also +by periods. + +The greatest functionality about this module which is provided by OpnERP is that user can print the reports +from general ledger of the selected accounts. If the user wants to generate reports of some selected +accounts only then the accounts should be selected from Accounts to include. So that the reports of the selected +accounts can be generated otherwise the reports of all accounts will also be generated. + """, + 'website': 'http://www.openerp.com', + 'images' : [], + 'init_xml': [], + "depends" : ["account"], + 'update_xml': [ + 'wizard/wizard_account_general_ledger_view.xml', + 'account_general_ledger_report.xml', + ], + 'demo_xml': [], + 'test': [], + 'installable': True, + 'auto_install': False, +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: === added file 'account_general_ledger/account_general_ledger_report.xml' --- account_general_ledger/account_general_ledger_report.xml 1970-01-01 00:00:00 +0000 +++ account_general_ledger/account_general_ledger_report.xml 2012-06-01 09:27:22 +0000 @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <report auto="False" id="account_general_ledger" menu="False" + model="account.account" + name="account.general.ledger_accounts" + rml="account/report/account_general_ledger.rml" + string="General Ledger"/> + <report auto="False" id="account_general_ledger_landscape" menu="False" + model="account.account" + name="account.general.ledger_landscape_accounts" + rml="account/report/account_general_ledger_landscape.rml" + string="General Ledger"/> + + </data> +</openerp> === added directory 'account_general_ledger/report' === added file 'account_general_ledger/report/__init__.py' --- account_general_ledger/report/__init__.py 1970-01-01 00:00:00 +0000 +++ account_general_ledger/report/__init__.py 2012-06-01 09:27:22 +0000 @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# 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 <http://www.gnu.org/licenses/>. +# +############################################################################## + +import account_general_ledger_report + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file === added file 'account_general_ledger/report/account_general_ledger_report.py' --- account_general_ledger/report/account_general_ledger_report.py 1970-01-01 00:00:00 +0000 +++ account_general_ledger/report/account_general_ledger_report.py 2012-06-01 09:27:22 +0000 @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2006-2010 OpenERP S.A +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsibility of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# guarantees and support are strongly advised to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from report import report_sxw +from account.report.account_general_ledger import general_ledger + + +class general_ledger_report(general_ledger): + _name = 'report.account.general.ledger_accounts' + + def set_context(self, objects, data, ids, report_type=None): + self.account_ids = data['form']['account_ids'] + if (data['model'] == 'account.account'): + new_ids = ids + objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids) + return super(general_ledger_report, self).set_context(objects, data, new_ids, report_type=report_type) + data['model'] = 'account.account' + if self.account_ids: + new_ids = self.account_ids + else: + new_ids = [data['form']['chart_account_id']] + objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids) + return super(general_ledger_report, self).set_context(objects, data, new_ids, report_type=report_type) + +report_sxw.report_sxw('report.account.general.ledger_accounts', 'account.account', 'addons/account/report/account_general_ledger.rml', parser=general_ledger_report, header='internal') +report_sxw.report_sxw('report.account.general.ledger_landscape_accounts', 'account.account', 'addons/account/report/account_general_ledger_landscape.rml', parser=general_ledger_report, header='internal landscape') + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: === added directory 'account_general_ledger/wizard' === added file 'account_general_ledger/wizard/__init__.py' --- account_general_ledger/wizard/__init__.py 1970-01-01 00:00:00 +0000 +++ account_general_ledger/wizard/__init__.py 2012-06-01 09:27:22 +0000 @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# 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 <http://www.gnu.org/licenses/>. +# +############################################################################## + +import wizard_account_general_ledger + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file === added file 'account_general_ledger/wizard/wizard_account_general_ledger.py' --- account_general_ledger/wizard/wizard_account_general_ledger.py 1970-01-01 00:00:00 +0000 +++ account_general_ledger/wizard/wizard_account_general_ledger.py 2012-06-01 09:27:22 +0000 @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# +# 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 <http://www.gnu.org/licenses/>. +# +############################################################################## + +from osv import fields, osv +from lxml import etree + +class account_general_ledger(osv.osv_memory): + _inherit = "account.report.general.ledger" + _description = "Account General Ledger" + _columns = { + 'account_ids': fields.many2many('account.account', 'account_balance_account_list_rel', 'acc_balance_id','account_id','Account'), + } + + def _print_report(self, cr, uid, ids, data, context=None): + if context is None: + context = {} + data = self.pre_print_report(cr, uid, ids, data, context=context) + data['form'].update(self.read(cr, uid, ids, ['account_ids','landscape', 'initial_balance', 'amount_currency', 'sortby'])[0]) + if not data['form']['fiscalyear_id']: + data['form'].update({'initial_balance': False}) + if data['form']['landscape']: + return { 'type': 'ir.actions.report.xml', 'report_name': 'account.general.ledger_landscape_accounts', 'datas': data} + return { 'type': 'ir.actions.report.xml', 'report_name': 'account.general.ledger_accounts', 'datas': data} + +account_general_ledger() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file === added file 'account_general_ledger/wizard/wizard_account_general_ledger_view.xml' --- account_general_ledger/wizard/wizard_account_general_ledger_view.xml 1970-01-01 00:00:00 +0000 +++ account_general_ledger/wizard/wizard_account_general_ledger_view.xml 2012-06-01 09:27:22 +0000 @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + + <!-- + Account General Ledger + --> + + <record id="account_general_ledger_form_view" model="ir.ui.view"> + <field name="name">account.general.ledger.form</field> + <field name="model">account.report.general.ledger</field> + <field name="type">form</field> + <field name="inherit_id" ref="account.account_common_report_view"/> + <field name="arch" type="xml"> + <notebook colspan="4" > + <page string="Accounts to include" name="account_ids" invisible="context.get('active_model',False)"> + <group colspan="4"> + <field name="account_ids" nolabel="1" colspan="4" /> + </group> + </page> + </notebook> + </field> + </record> + + </data> +</openerp> \ No newline at end of file
_______________________________________________ Mailing list: https://launchpad.net/~openerp-dev-gtk Post to : [email protected] Unsubscribe : https://launchpad.net/~openerp-dev-gtk More help : https://help.launchpad.net/ListHelp

