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.

24 lines
894 B

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