mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[IMP] report_async: pre-commit auto fixes
This commit is contained in:
committed by
Atchuthan, Sodexis
parent
ae6b4cc924
commit
21310d51a7
@@ -11,7 +11,7 @@ class Report(models.Model):
|
||||
_inherit = "ir.actions.report"
|
||||
|
||||
def report_action(self, docids, data=None, config=True):
|
||||
res = super(Report, self).report_action(docids, data=data, config=config)
|
||||
res = super().report_action(docids, data=data, config=config)
|
||||
if res["context"].get("async_process", False):
|
||||
rpt_async_id = res["context"]["active_id"]
|
||||
report_async = self.env["report.async"].browse(rpt_async_id)
|
||||
|
||||
@@ -98,7 +98,7 @@ class ReportAsync(models.Model):
|
||||
order="id desc",
|
||||
)
|
||||
for rec in self:
|
||||
rec.file_ids = files.filtered(lambda l: l.res_id == rec.id)
|
||||
rec.file_ids = files.filtered(lambda file, rec=rec: file.res_id == rec.id)
|
||||
|
||||
def run_now(self):
|
||||
self.ensure_one()
|
||||
@@ -142,7 +142,7 @@ class ReportAsync(models.Model):
|
||||
# Run report
|
||||
out_file, file_ext = getattr(report, func)(report.xml_id, docids, data)
|
||||
out_file = base64.b64encode(out_file)
|
||||
out_name = "{}.{}".format(report.name, file_ext)
|
||||
out_name = f"{report.name}.{file_ext}"
|
||||
# Save report to attachment
|
||||
attachment = (
|
||||
self.env["ir.attachment"]
|
||||
|
||||
Reference in New Issue
Block a user