OCA reporting engine fork for dev and update.
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.

25 lines
914 B

  1. # Copyright 2009-2018 Noviat
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from odoo import api, models
  4. class ResPartner(models.Model):
  5. _inherit = 'res.partner'
  6. @api.multi
  7. def export_xls(self):
  8. module = __name__.split('addons.')[1].split('.')[0]
  9. report_name = '{}.partner_export_xlsx'.format(module)
  10. report = {
  11. 'type': 'ir.actions.report',
  12. 'report_type': 'xlsx',
  13. 'report_name': report_name,
  14. # model name will be used if no report_file passed via context
  15. 'context': dict(self.env.context, report_file='partner'),
  16. # report_xlsx doesn't pass the context if the data dict is empty
  17. # cf. report_xlsx\static\src\js\report\qwebactionmanager.js
  18. # TODO: create PR on report_xlsx to fix this
  19. 'data': {'dynamic_report': True},
  20. }
  21. return report