Skip to content

[15.0][MIG] report_qweb_pdf_watermark - #680

Merged
OCA-git-bot merged 31 commits into
OCA:15.0from
bosd:15.0-mig-report_qweb_pdf_watermark
Dec 29, 2022
Merged

OCA-git-bot merged 31 commits into
OCA:15.0from
bosd:15.0-mig-report_qweb_pdf_watermark

Conversation

@bosd

@bosd bosd commented Nov 3, 2022

Copy link
Copy Markdown
Contributor
  • Standard migration
  • Updated instructions
  • Added Global Company Watermark

hbrunn and others added 30 commits November 1, 2022 07:04
When no background configuration is present on the report definition,
don't try to browse the report model especially because this breaks
some upstream reports (see odoo/odoo#23389)
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-11.0/reporting-engine-11.0-report_qweb_pdf_watermark
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-11-0/reporting-engine-11-0-report_qweb_pdf_watermark/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-12.0/reporting-engine-12.0-report_qweb_pdf_watermark
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-report_qweb_pdf_watermark/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-12.0/reporting-engine-12.0-report_qweb_pdf_watermark
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-report_qweb_pdf_watermark/
@bosd
bosd force-pushed the 15.0-mig-report_qweb_pdf_watermark branch from b4c6518 to 2d81120 Compare November 5, 2022 09:23
[MIG] report_qweb_pdf_watermark: Migration to 15.0
@bosd
bosd force-pushed the 15.0-mig-report_qweb_pdf_watermark branch from 2d81120 to 0f64e92 Compare November 5, 2022 09:30
@bosd bosd mentioned this pull request Nov 5, 2022
20 tasks
@bosd

bosd commented Nov 5, 2022

Copy link
Copy Markdown
Contributor Author

@kittiu Can you please review?

@bosd

bosd commented Nov 5, 2022

Copy link
Copy Markdown
Contributor Author

@grzana12 Can you please review?

Comment thread report_qweb_pdf_watermark/models/report.py
Comment thread report_qweb_pdf_watermark/models/report.py
@bosd

bosd commented Nov 8, 2022

Copy link
Copy Markdown
Contributor Author

@CasVissers-360ERP Can you review?

@CasVissers-360ERP CasVissers-360ERP 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.

Functional review!

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

_inherit = "ir.actions.report"

pdf_watermark = fields.Binary("Watermark")
use_company_watermark = fields.Boolean(

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.

A migration script is needed for this case

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@etobella Could you explain why an migration script would be needed?
The field pdf_watermark still exsists. See line 43
14.0...bosd:reporting-engine:15.0-mig-report_qweb_pdf_watermark#diff-66dceb063022cd58404dbbbb4649ffec677cbc89be10c385ad5714231929a220R34

The other field are a new addition, and should not cause a problem when migrating, right?

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.

If you migrate you will need to access all reports with watermarks in order to set the boolean to true. That is the migration needed...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, now I think I understand.
By toggling the boolean you want to migrate the exsisting watermarks on the reports to the new use_company_watermark function.
I don’t think we want a migration script for that 😄

The use_company_watermark is an additional new function. 🎉
The current functionality of the pdf_watermark which can be defined on a per report basis is kept as is.

In the current situation after migrating to V15 the watermark on these reports stay unchanged.
So the result on V15 will look exactly the same as on V14. This is what we want. 👍

For example if we would like to automatically migrate exsisting reports to the new use_company_watermark function things will get complicated and error prone.

Example:
If this module is installed on a V14 database one could have the situation that there is a different watermark specified for a SO report then a Warehouse out report.

E.g.
An SO report could have set an pdf_watermark.
mywatermark1.pdf

The Warehouse delivery report could have mywatermark2.pdf

Migrating existing pdf watermarks to the new use_global_watermark function is becoming complicated very quickly and could lead to unwanted results when done by a migration script.
In above situation the script must decide to either set mywatermark1.pdf or mywatermark2.pdf as the global company watermark.
If there are even more then 3 watermark pdf’sor custom regexes used things get unnecessary complicated.

In that scenario, it is much easier for an human to change to the global company watermark function trough the UI for those who want to use it.

@bosd bosd Nov 23, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@etobella Do you agree with with above explanation of the way of working?
Can we merge this one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ping @etobella

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.

Ouch, I see, sorry for the misunderstanding

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

NP, Thanks for the review/merge!!

@bosd

bosd commented Nov 24, 2022

Copy link
Copy Markdown
Contributor Author

/ocabot migration report_qweb_pdf_watermark

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Sorry @bosd you are not allowed to mark the addon tobe migrated.

To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons.

If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the maintainers key of its manifest.

@bosd
bosd requested a review from etobella November 30, 2022 07:43
@simahawk

Copy link
Copy Markdown
Contributor

/ocabot migration report_qweb_pdf_watermark

@OCA-git-bot OCA-git-bot added this to the 15.0 milestone Dec 20, 2022
@etobella

Copy link
Copy Markdown
Member

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 15.0-ocabot-merge-pr-680-by-etobella-bump-nobump, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 7be02f8 into OCA:15.0 Dec 29, 2022
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 68c6841. 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.