Skip to content

Commit

Permalink
Merge PR #797 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by gurneyalex
  • Loading branch information
OCA-git-bot committed Dec 8, 2023
2 parents 79d6736 + c1e2921 commit 838aa45
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 4 additions & 3 deletions report_qweb_encrypt/models/ir_actions_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ class IrActionsReport(models.Model):
help="Python code syntax to gnerate password.",
)

def _render_qweb_pdf(self, reportname, res_ids=None, data=None):
def _render_qweb_pdf(self, report_ref, res_ids=None, data=None):
document, ttype = super()._render_qweb_pdf(
reportname, res_ids=res_ids, data=data
report_ref, res_ids=res_ids, data=data
)
report = self._get_report(report_ref)
if res_ids:
encrypt_password = self._context.get("encrypt_password")
report = self._get_report(reportname).with_context(
report = self._get_report_from_name(report.report_name).with_context(
encrypt_password=encrypt_password
)
password = report._get_pdf_password(res_ids[:1])
Expand Down
7 changes: 7 additions & 0 deletions report_substitute/models/ir_actions_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ def _render(self, report_ref, res_ids, data=None):
substitution_report.report_name, res_ids, data=data
)

def _render_qweb_pdf(self, report_ref, res_ids=None, data=None):
report = self._get_report(report_ref)
substitution_report = report.get_substitution_report(res_ids)
return super(IrActionReport, self)._render_qweb_pdf(
substitution_report, res_ids=res_ids, data=data
)

def report_action(self, docids, data=None, config=True):
if docids:
if isinstance(docids, models.Model):
Expand Down

0 comments on commit 838aa45

Please sign in to comment.