You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.8 KiB

11 years ago
11 years ago
  1. # -*- coding: utf-8 -*-
  2. ##############################################################################
  3. #
  4. # OpenERP, Open Source Management Solution
  5. #
  6. # Copyright (c) 2013 Noviat nv/sa (www.noviat.com). 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. from openerp.osv import orm
  23. # import logging
  24. # _logger = logging.getLogger(__name__)
  25. class open_invoices_webkit_wizard(orm.TransientModel):
  26. _inherit = 'open.invoices.webkit'
  27. def xls_export(self, cr, uid, ids, context=None):
  28. return self.check_report(cr, uid, ids, context=context)
  29. def _print_report(self, cr, uid, ids, data, context=None):
  30. context = context or {}
  31. if context.get('xls_export'):
  32. # we update form with display account value
  33. data = self.pre_print_report(cr, uid, ids, data, context=context)
  34. return {'type': 'ir.actions.report.xml',
  35. 'report_name': 'account.account_report_open_invoices_xls',
  36. 'datas': data}
  37. else:
  38. return super(open_invoices_webkit_wizard, self)._print_report(
  39. cr, uid, ids, data, context=context)