[MIG] report_xlsx: Migration to 14.0

This commit is contained in:
Alex Cuellar
2020-10-19 15:42:11 -05:00
committed by Dario Del Zozzo
parent 82d14e805e
commit 8d4482017b
6 changed files with 23 additions and 21 deletions

View File

@@ -8,10 +8,12 @@ from odoo.exceptions import UserError
class ReportAction(models.Model):
_inherit = "ir.actions.report"
report_type = fields.Selection(selection_add=[("xlsx", "XLSX")])
report_type = fields.Selection(
selection_add=[("xlsx", "XLSX")], ondelete={"xlsx": "set default"}
)
@api.model
def render_xlsx(self, docids, data):
def _render_xlsx(self, docids, data):
report_model_name = "report.%s" % self.report_name
report_model = self.env.get(report_model_name)
if report_model is None: