Skip to content

[20.0][MIG] report_qweb_pdf_watermark: Migration to 20.0 - #1207

Open
BhaveshHeliconia wants to merge 35 commits into
OCA:20.0from
HeliconiaIO:20.0-mig-report_qweb_pdf_watermark
Open

BhaveshHeliconia wants to merge 35 commits into
OCA:20.0from
HeliconiaIO:20.0-mig-report_qweb_pdf_watermark

Conversation

@BhaveshHeliconia

Copy link
Copy Markdown

No description provided.

@OCA-git-bot OCA-git-bot added mod:report_qweb_pdf_watermark Module report_qweb_pdf_watermark series:20.0 labels Oct 5, 2026
@pedrobaeza

Copy link
Copy Markdown
Member

/ocabot migration report_qweb_pdf_watermark

@OCA-git-bot OCA-git-bot added this to the 20.0 milestone Oct 5, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Oct 5, 2026
3 of 22 tasks
@BhaveshHeliconia
BhaveshHeliconia force-pushed the 20.0-mig-report_qweb_pdf_watermark branch from 3e1f73d to 2e1eb11 Compare October 5, 2026 10:48
@StefanRijnhart

Copy link
Copy Markdown
Member

Can you have a look at the tests?

@BhaveshHeliconia
BhaveshHeliconia force-pushed the 20.0-mig-report_qweb_pdf_watermark branch from 2e1eb11 to 385b012 Compare November 30, 2026 07:22
@oca-cla-bot

oca-cla-bot Bot commented Nov 30, 2026

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

CLA not signed

@BhaveshHeliconia

Copy link
Copy Markdown
Author

Can you have a look at the tests?

The tests are green now. Thanks!

@StefanRijnhart StefanRijnhart 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.

Oh, when you did the migration, the 19.0 migration was not merged yet but it is now. Can you rebuild the branch on current 19.0?

sanderlienaerts and others added 16 commits November 30, 2026 15:40
When printing a document in a multi-company environment, the company
watermark was selected based on self.env.company (the company currently
active in the UI switcher) rather than the company of the document being
printed. This caused the wrong watermark to appear when a user switched
to company B and printed an invoice belonging to company A (or vice
versa), as reported in OCA#1134.

Fix by introducing a _get_watermark_company() helper that returns the
document's company_id when available, falling back to self.env.company
otherwise.
The module only tried to import PyPDF2, so on hosts that ship pypdf
(Odoo 19 on Python >= 3.13) PdfReader/PdfWriter stayed undefined and
rendering a watermarked report crashed with a NameError.

Import the PDF classes from odoo.tools.pdf instead, which picks PyPDF2
2.x, pypdf or PyPDF2 1.x and keeps the legacy method names used here.
Drop the obsolete INSTALL instructions to pip install PyPDF2.

Addresses OCA#1091 (review)

Co-authored-by: DjodyKort <90830682+DjodyKort@users.noreply.github.com>
…pany

Resolve the watermark company like core does: use the documents'
company_id, then company_ids, and fall back to the environment company.
Documents of models that only have company_ids now get their own
company's watermark, and the first document that carries a company is
used rather than only the first document.

Add tests for the company resolution.
Currently translated at 20.0% (2 of 10 strings)

Translation: reporting-engine-19.0/reporting-engine-19.0-report_qweb_pdf_watermark
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-19-0/reporting-engine-19-0-report_qweb_pdf_watermark/pl/
@BhaveshHeliconia
BhaveshHeliconia force-pushed the 20.0-mig-report_qweb_pdf_watermark branch from 385b012 to f25a641 Compare November 30, 2026 10:20
@BhaveshHeliconia

BhaveshHeliconia commented Nov 30, 2026 •

Copy link
Copy Markdown
Author

@StefanRijnhart Thanks for the review! I've rerun the migration process from 19.0 to 20.0 and addressed your comments.

@BhaveshHeliconia
BhaveshHeliconia force-pushed the 20.0-mig-report_qweb_pdf_watermark branch from f25a641 to 86cc30b Compare December 1, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:report_qweb_pdf_watermark Module report_qweb_pdf_watermark series:20.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.