1
# -*- coding: utf-8 -*-
2
##############################################################################
4
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
5
# Copyright (C) 2011-2012 Associazione OpenERP Italia
6
# (<http://www.openerp-italia.org>).
9
# This program is free software: you can redistribute it and/or modify
10
# it under the terms of the GNU Affero General Public License as published by
11
# the Free Software Foundation, either version 3 of the License, or
12
# (at your option) any later version.
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
19
# You should have received a copy of the GNU Affero General Public License
20
# along with this program. If not, see <http://www.gnu.org/licenses/>.
22
##############################################################################
24
from osv import fields, osv
26
class account_report_prima_nota_cassa(osv.osv_memory):
27
_inherit = "account.common.account.report"
28
_name = 'account.report.prima_nota_cassa'
29
_description = "Print Prima Nota Cassa"
32
def _get_all_journal(self, cr, uid, context=None):
33
return self.pool.get('account.journal').search(cr, uid , [('type','in',['cash','bank'])] )
35
def _print_report(self, cr, uid, ids, data, context=None):
38
data = self.pre_print_report(cr, uid, ids, data, context=context)
39
data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby'])[0])
40
if not data['form']['fiscalyear_id']:# GTK client problem onchange does not consider in save record
41
data['form'].update({'initial_balance': False})
42
return { 'type': 'ir.actions.report.xml', 'report_name': 'account.print.prima_nota_cassa', 'datas': data}
48
'journal_ids': _get_all_journal,
52
account_report_prima_nota_cassa()
54
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: