Skip to content

[16.0][REF] report_qweb_signer: make signing functions reusable - #988

Merged
OCA-git-bot merged 1 commit into
OCA:16.0from
lambdao-dev:16.0-signerref-len
Mar 11, 2025
Merged

[16.0][REF] report_qweb_signer: make signing functions reusable#988
OCA-git-bot merged 1 commit into
OCA:16.0from
lambdao-dev:16.0-signerref-len

Conversation

@len-foss

Copy link
Copy Markdown

This is a simple refactoring to make it easy to reuse the signing code.
Without this, report_py3o_signer would have to duplicate a lot of code.
See: #987

@pedrobaeza pedrobaeza changed the title [REF] report_qweb_signer: make signing functions reusable [16.0][REF] report_qweb_signer: make signing functions reusable Mar 10, 2025
@pedrobaeza pedrobaeza added this to the 16.0 milestone Mar 10, 2025

def _render_qweb_pdf(self, report_ref, res_ids=None, data=None):
report = self._get_report(report_ref)
certificate = self._certificate_get(report, res_ids)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should go in the method _sign_pdf_and_attach, don't you think?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @pedrobaeza :-)
You really need to methods, one that goes before the super, and one that goes after.
Since the super is not the same if you're operating on another report type, that wouldn't work. (I'm not 100% sure I interpreted your remark in the correct way, let me know if I'm wrong)

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I see the certificate is also used in the method before the super. Forget it.

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pedrobaeza

Copy link
Copy Markdown
Member

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-988-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit d645366 into OCA:16.0 Mar 11, 2025
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at f35b796. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants