update: report_xlsx to OCA 19.0 version (19.0.1.0.2)

🤖 assisted by claude
This commit is contained in:
Ernad Husremovic 2026-03-09 22:16:29 +01:00
parent 8566ac3819
commit 32a4fa90f7
23 changed files with 201 additions and 206 deletions

View file

@ -19,14 +19,14 @@ class ReportAction(models.Model):
@api.model
def _render_xlsx(self, report_ref, docids, data):
report_sudo = self._get_report(report_ref)
report_model_name = "report.%s" % report_sudo.report_name
report_model_name = f"report.{report_sudo.report_name}"
report_model = self.env[report_model_name]
ret = (
report_model.with_context(active_model=report_sudo.model)
.sudo(False)
.create_xlsx_report(docids, data) # noqa
)
if ret and isinstance(ret, (tuple, list)): # data, "xlsx"
if ret and isinstance(ret, (tuple | list)): # data, "xlsx"
report_sudo.save_xlsx_report_attachment(docids, ret[0])
return ret