~bcim/account-invoicing/saas1-belgium

« back to all changes in this revision

Viewing changes to account_financial_report_webkit_xls/wizard/general_ledger_wizard.py

  • Committer: openerp
  • Date: 2013-07-05 19:31:22 UTC
  • Revision ID: openerp@oerp70-20130705193122-wn2b1srud6dj8qrw
update *_xls modules

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- encoding: utf-8 -*-
 
2
##############################################################################
 
3
#
 
4
#    OpenERP, Open Source Management Solution
 
5
#    
 
6
#    Copyright (c) 2013 Noviat nv/sa (www.noviat.be). All rights reserved.
 
7
 
8
#    This program is free software: you can redistribute it and/or modify
 
9
#    it under the terms of the GNU Affero General Public License as
 
10
#    published by the Free Software Foundation, either version 3 of the
 
11
#    License, or (at your option) any later version.
 
12
#
 
13
#    This program is distributed in the hope that it will be useful,
 
14
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
#    GNU Affero General Public License for more details.
 
17
#
 
18
#    You should have received a copy of the GNU Affero General Public License
 
19
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
#
 
21
##############################################################################
 
22
 
 
23
from osv import fields, osv
 
24
#import logging
 
25
#_logger = logging.getLogger(__name__)
 
26
 
 
27
class general_ledger_webkit_wizard(osv.osv_memory):
 
28
    _inherit = 'general.ledger.webkit'
 
29
       
 
30
    def xls_export(self, cr, uid, ids, context=None):
 
31
        return self.check_report(cr, uid, ids, context=context)
 
32
 
 
33
    def _print_report(self, cr, uid, ids, data, context=None):
 
34
        context = context or {}
 
35
        if context.get('xls_export'):
 
36
            # we update form with display account value
 
37
            data = self.pre_print_report(cr, uid, ids, data, context=context)
 
38
            return {'type': 'ir.actions.report.xml',
 
39
                    'report_name': 'account.account_report_general_ledger_xls',
 
40
                    'datas': data}
 
41
        else:
 
42
            return super(general_ledger_webkit_wizard, self)._print_report(cr, uid, ids, data, context=context)
 
43
    
 
44
general_ledger_webkit_wizard()