~l-turchetti/openobject-italia/add_account_central_journal

« back to all changes in this revision

Viewing changes to l10n_it_prima_nota_cassa/wizard/wizard_print_prima_nota_cassa.py

[ADD] l10n_it_prima_nota_cassa
merging lp:~openobject-italia-core-devs/openobject-italia/adding_l10n_it_prima_nota_cassa
moving not working revisions to lp:~openobject-italia-core-devs/openobject-italia/adding_l10n_it_prima_nota_cassa_trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
##############################################################################
 
3
#    
 
4
#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
 
5
#    Copyright (C) 2011-2012 Associazione OpenERP Italia
 
6
#    (<http://www.openerp-italia.org>). 
 
7
#    All Rights Reserved
 
8
#
 
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.
 
13
#
 
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.
 
18
#
 
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/>.
 
21
#
 
22
##############################################################################
 
23
 
 
24
from osv import fields, osv
 
25
 
 
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"
 
30
 
 
31
 
 
32
    def _get_all_journal(self, cr, uid, context=None):
 
33
        return self.pool.get('account.journal').search(cr, uid , [('type','in',['cash','bank'])] )
 
34
 
 
35
    def _print_report(self, cr, uid, ids, data, context=None):
 
36
        if context is None:
 
37
            context = {}
 
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}
 
43
 
 
44
    _columns = {
 
45
 
 
46
    }
 
47
    _defaults = {
 
48
        'journal_ids': _get_all_journal,
 
49
    }
 
50
 
 
51
 
 
52
account_report_prima_nota_cassa()
 
53
 
 
54
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: