2010-04-23 12:07:48 +00:00
|
|
|
# -*- 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
|
|
|
|
|
|
|
|
class account_partner_ledger(osv.osv_memory):
|
|
|
|
"""
|
|
|
|
This wizard will provide the partner Ledger report by periods, between any two dates.
|
|
|
|
"""
|
|
|
|
_name = 'account.partner.ledger'
|
2010-07-13 11:48:47 +00:00
|
|
|
_inherit = 'account.common.partner.report'
|
2010-04-23 12:07:48 +00:00
|
|
|
_description = 'Account Partner Ledger'
|
|
|
|
_columns = {
|
|
|
|
'soldeinit': fields.boolean('Include initial balances'),
|
|
|
|
'reconcil': fields.boolean('Include Reconciled Entries'),
|
|
|
|
'page_split': fields.boolean('One Partner Per Page'),
|
2010-07-14 06:06:18 +00:00
|
|
|
'amount_currency': fields.boolean("With Currency", help='Print report with currency column'),
|
2010-07-13 11:48:47 +00:00
|
|
|
}
|
|
|
|
_defaults = {
|
2010-07-14 04:37:02 +00:00
|
|
|
'reconcile' : True,
|
|
|
|
'soldeinit' : True,
|
|
|
|
'page_split' : False,
|
2010-04-23 12:07:48 +00:00
|
|
|
}
|
|
|
|
|
2010-07-13 11:48:47 +00:00
|
|
|
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
|
|
|
if context is None:
|
|
|
|
context = {}
|
|
|
|
data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
|
2010-07-14 06:06:18 +00:00
|
|
|
data['form'].update(self.read(cr, uid, ids, ['soldeinit', 'reconcil', 'page_split', 'amount_currency'])[0])
|
2010-04-23 12:07:48 +00:00
|
|
|
if data['form']['page_split']:
|
|
|
|
return {
|
|
|
|
'type': 'ir.actions.report.xml',
|
|
|
|
'report_name': 'account.third_party_ledger',
|
|
|
|
'datas': data,
|
2010-04-29 06:09:43 +00:00
|
|
|
'nodestroy':True,
|
2010-07-13 11:48:47 +00:00
|
|
|
}
|
|
|
|
return {
|
2010-04-23 12:07:48 +00:00
|
|
|
'type': 'ir.actions.report.xml',
|
|
|
|
'report_name': 'account.third_party_ledger_other',
|
|
|
|
'datas': data,
|
2010-04-29 06:09:43 +00:00
|
|
|
'nodestroy':True,
|
2010-04-23 12:07:48 +00:00
|
|
|
}
|
2010-07-14 04:37:02 +00:00
|
|
|
|
2010-04-23 12:07:48 +00:00
|
|
|
account_partner_ledger()
|
|
|
|
|
|
|
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|