From 18eb03d9a2518a97a57db6b1f5814c3703535a42 Mon Sep 17 00:00:00 2001 From: Sander Lienaerts Date: Fri, 12 Jan 2024 15:15:01 +0100 Subject: [PATCH] [IMP] report_qweb_pdf_watermark: black, isort, prettier --- report_qweb_pdf_watermark/README.rst | 99 ++++++++++--------- report_qweb_pdf_watermark/pyproject.toml | 3 + .../readme/CONTRIBUTORS.md | 7 ++ .../readme/CONTRIBUTORS.rst | 7 -- .../readme/DESCRIPTION.md | 5 + .../readme/DESCRIPTION.rst | 1 - report_qweb_pdf_watermark/readme/HISTORY.md | 20 ++++ report_qweb_pdf_watermark/readme/HISTORY.rst | 28 ------ .../readme/{INSTALL.rst => INSTALL.md} | 5 +- report_qweb_pdf_watermark/readme/ROADMAP.md | 3 + report_qweb_pdf_watermark/readme/ROADMAP.rst | 1 - report_qweb_pdf_watermark/readme/USAGE.md | 23 +++++ report_qweb_pdf_watermark/readme/USAGE.rst | 20 ---- .../static/description/index.html | 29 ++++-- 14 files changed, 135 insertions(+), 116 deletions(-) create mode 100644 report_qweb_pdf_watermark/pyproject.toml create mode 100644 report_qweb_pdf_watermark/readme/CONTRIBUTORS.md delete mode 100644 report_qweb_pdf_watermark/readme/CONTRIBUTORS.rst create mode 100644 report_qweb_pdf_watermark/readme/DESCRIPTION.md delete mode 100644 report_qweb_pdf_watermark/readme/DESCRIPTION.rst create mode 100644 report_qweb_pdf_watermark/readme/HISTORY.md delete mode 100644 report_qweb_pdf_watermark/readme/HISTORY.rst rename report_qweb_pdf_watermark/readme/{INSTALL.rst => INSTALL.md} (70%) create mode 100644 report_qweb_pdf_watermark/readme/ROADMAP.md delete mode 100644 report_qweb_pdf_watermark/readme/ROADMAP.rst create mode 100644 report_qweb_pdf_watermark/readme/USAGE.md delete mode 100644 report_qweb_pdf_watermark/readme/USAGE.rst diff --git a/report_qweb_pdf_watermark/README.rst b/report_qweb_pdf_watermark/README.rst index d2afa1534..f2a13ac7f 100644 --- a/report_qweb_pdf_watermark/README.rst +++ b/report_qweb_pdf_watermark/README.rst @@ -17,18 +17,22 @@ Pdf watermark :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github - :target: https://github.com/OCA/reporting-engine/tree/16.0/report_qweb_pdf_watermark + :target: https://github.com/OCA/reporting-engine/tree/17.0/report_qweb_pdf_watermark :alt: OCA/reporting-engine .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-report_qweb_pdf_watermark + :target: https://translation.odoo-community.org/projects/reporting-engine-17-0/reporting-engine-17-0-report_qweb_pdf_watermark :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -This module was written to add watermarks (backgrounds) to PDF reports. Because of the way wkhtmltopdf handles headers and footers in the current versions, it is quite impossible to have a background for the complete page using HTML and CSS. That is why this module inserts the image at the PDF level. +This module was written to add watermarks (backgrounds) to PDF reports. +Because of the way wkhtmltopdf handles headers and footers in the +current versions, it is quite impossible to have a background for the +complete page using HTML and CSS. That is why this module inserts the +image at the PDF level. **Table of contents** @@ -38,71 +42,74 @@ This module was written to add watermarks (backgrounds) to PDF reports. Because Installation ============ +As PyPDF is not supported in python3, you need to install PyPDF2: -As PyPDF is not supported in python3, you need to install PyPDF2:: +:: -$ pip install pypdf2 + $ pip install pypdf2 Usage ===== To use this module, you need to: -#. go to your report -#. select a PDF or image to use as watermark. Note that resolutions and size must match, otherwise you'll have funny results -#. You can also fill in an expression that returns the data (base64 encoded) to be used as watermark +1. go to your report +2. select a PDF or image to use as watermark. Note that resolutions and + size must match, otherwise you'll have funny results +3. You can also fill in an expression that returns the data (base64 + encoded) to be used as watermark To use the Company watermark, you need to: -#. go to settings --> company --> update info -#. upload an pdf watermark -#. go to settings --> technical --> reporting --> reports -#. Select the report where you want to use it. -#. On the 'Advanced Properties' tab of the notebook check 'use company watermark' +1. go to settings --> company --> update info +2. upload an pdf watermark +3. go to settings --> technical --> reporting --> reports +4. Select the report where you want to use it. +5. On the 'Advanced Properties' tab of the notebook check 'use company + watermark' -### Demo -And demo report is available (if you have demo data installed) on the users form view. +### Demo And demo report is available (if you have demo data installed) +on the users form view. -#. go to Configuration --> users -#. Select an users -#. Click the print button --> Watermark Demo report. +1. go to Configuration --> users +2. Select an users +3. Click the print button --> Watermark Demo report. Known issues / Roadmap ====================== -This module depends on support for transparent backgrounds in Wkhtmltopdf, which has been flaky in the past. This module has been reported to work with Wkhtmltopdf 0.12.4. +This module depends on support for transparent backgrounds in +Wkhtmltopdf, which has been flaky in the past. This module has been +reported to work with Wkhtmltopdf 0.12.4. Changelog ========= 12.0.1.0.0 (2019-11-18) -~~~~~~~~~~~~~~~~~~~~~~~ - -* [MIG] Migration to V12. +----------------------- +- [MIG] Migration to V12. 13.0.1.0.0 (2021-01-27) -~~~~~~~~~~~~~~~~~~~~~~~ - -* [MIG] Migration to V13. +----------------------- +- [MIG] Migration to V13. 14.0.1.0.0 (2021-01-29) -~~~~~~~~~~~~~~~~~~~~~~~ - -* [MIG] Migration to V14. +----------------------- +- [MIG] Migration to V14. 15.0.1.0.0 (2022-01-11) -~~~~~~~~~~~~~~~~~~~~~~~ +----------------------- -* [MIG] Migration to V15. -* Define pdf watermark in company settings +- [MIG] Migration to V15. +- Define pdf watermark in company settings 16.0.1.0.0 (2023-03-13) -~~~~~~~~~~~~~~~~~~~~~~~ +----------------------- -* [MIG] Migration to V16. +- [MIG] Migration to V16. Bug Tracker =========== @@ -110,7 +117,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -118,23 +125,23 @@ Credits ======= Authors -~~~~~~~ +------- * Therp BV Contributors -~~~~~~~~~~~~ +------------ -* Holger Brunn -* Stefan Rijnhart -* Rod Schouteden -* Robin Goots -* Foram Shah -* Emiel van Bokhoven -* Anjeel Haria +- Holger Brunn +- Stefan Rijnhart +- Rod Schouteden +- Robin Goots +- Foram Shah +- Emiel van Bokhoven +- Anjeel Haria Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -146,6 +153,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/reporting-engine `_ project on GitHub. +This module is part of the `OCA/reporting-engine `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/report_qweb_pdf_watermark/pyproject.toml b/report_qweb_pdf_watermark/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/report_qweb_pdf_watermark/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/report_qweb_pdf_watermark/readme/CONTRIBUTORS.md b/report_qweb_pdf_watermark/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..ad0c79fb3 --- /dev/null +++ b/report_qweb_pdf_watermark/readme/CONTRIBUTORS.md @@ -0,0 +1,7 @@ +- Holger Brunn \<\> +- Stefan Rijnhart \<\> +- Rod Schouteden \<\> +- Robin Goots \<\> +- Foram Shah \<\> +- Emiel van Bokhoven \<\> +- Anjeel Haria diff --git a/report_qweb_pdf_watermark/readme/CONTRIBUTORS.rst b/report_qweb_pdf_watermark/readme/CONTRIBUTORS.rst deleted file mode 100644 index cd5afe984..000000000 --- a/report_qweb_pdf_watermark/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,7 +0,0 @@ -* Holger Brunn -* Stefan Rijnhart -* Rod Schouteden -* Robin Goots -* Foram Shah -* Emiel van Bokhoven -* Anjeel Haria diff --git a/report_qweb_pdf_watermark/readme/DESCRIPTION.md b/report_qweb_pdf_watermark/readme/DESCRIPTION.md new file mode 100644 index 000000000..5579135f4 --- /dev/null +++ b/report_qweb_pdf_watermark/readme/DESCRIPTION.md @@ -0,0 +1,5 @@ +This module was written to add watermarks (backgrounds) to PDF reports. +Because of the way wkhtmltopdf handles headers and footers in the +current versions, it is quite impossible to have a background for the +complete page using HTML and CSS. That is why this module inserts the +image at the PDF level. diff --git a/report_qweb_pdf_watermark/readme/DESCRIPTION.rst b/report_qweb_pdf_watermark/readme/DESCRIPTION.rst deleted file mode 100644 index 31f5962e1..000000000 --- a/report_qweb_pdf_watermark/readme/DESCRIPTION.rst +++ /dev/null @@ -1 +0,0 @@ -This module was written to add watermarks (backgrounds) to PDF reports. Because of the way wkhtmltopdf handles headers and footers in the current versions, it is quite impossible to have a background for the complete page using HTML and CSS. That is why this module inserts the image at the PDF level. diff --git a/report_qweb_pdf_watermark/readme/HISTORY.md b/report_qweb_pdf_watermark/readme/HISTORY.md new file mode 100644 index 000000000..7134b9d02 --- /dev/null +++ b/report_qweb_pdf_watermark/readme/HISTORY.md @@ -0,0 +1,20 @@ +## 12.0.1.0.0 (2019-11-18) + +- \[MIG\] Migration to V12. + +## 13.0.1.0.0 (2021-01-27) + +- \[MIG\] Migration to V13. + +## 14.0.1.0.0 (2021-01-29) + +- \[MIG\] Migration to V14. + +## 15.0.1.0.0 (2022-01-11) + +- \[MIG\] Migration to V15. +- Define pdf watermark in company settings + +## 16.0.1.0.0 (2023-03-13) + +- \[MIG\] Migration to V16. diff --git a/report_qweb_pdf_watermark/readme/HISTORY.rst b/report_qweb_pdf_watermark/readme/HISTORY.rst deleted file mode 100644 index caf0c913c..000000000 --- a/report_qweb_pdf_watermark/readme/HISTORY.rst +++ /dev/null @@ -1,28 +0,0 @@ -12.0.1.0.0 (2019-11-18) -~~~~~~~~~~~~~~~~~~~~~~~ - -* [MIG] Migration to V12. - - -13.0.1.0.0 (2021-01-27) -~~~~~~~~~~~~~~~~~~~~~~~ - -* [MIG] Migration to V13. - - -14.0.1.0.0 (2021-01-29) -~~~~~~~~~~~~~~~~~~~~~~~ - -* [MIG] Migration to V14. - - -15.0.1.0.0 (2022-01-11) -~~~~~~~~~~~~~~~~~~~~~~~ - -* [MIG] Migration to V15. -* Define pdf watermark in company settings - -16.0.1.0.0 (2023-03-13) -~~~~~~~~~~~~~~~~~~~~~~~ - -* [MIG] Migration to V16. diff --git a/report_qweb_pdf_watermark/readme/INSTALL.rst b/report_qweb_pdf_watermark/readme/INSTALL.md similarity index 70% rename from report_qweb_pdf_watermark/readme/INSTALL.rst rename to report_qweb_pdf_watermark/readme/INSTALL.md index dc11dadce..9c0fa342f 100644 --- a/report_qweb_pdf_watermark/readme/INSTALL.rst +++ b/report_qweb_pdf_watermark/readme/INSTALL.md @@ -1,4 +1,3 @@ +As PyPDF is not supported in python3, you need to install PyPDF2: -As PyPDF is not supported in python3, you need to install PyPDF2:: - -$ pip install pypdf2 + $ pip install pypdf2 diff --git a/report_qweb_pdf_watermark/readme/ROADMAP.md b/report_qweb_pdf_watermark/readme/ROADMAP.md new file mode 100644 index 000000000..e848ba42f --- /dev/null +++ b/report_qweb_pdf_watermark/readme/ROADMAP.md @@ -0,0 +1,3 @@ +This module depends on support for transparent backgrounds in +Wkhtmltopdf, which has been flaky in the past. This module has been +reported to work with Wkhtmltopdf 0.12.4. diff --git a/report_qweb_pdf_watermark/readme/ROADMAP.rst b/report_qweb_pdf_watermark/readme/ROADMAP.rst deleted file mode 100644 index 22c286a80..000000000 --- a/report_qweb_pdf_watermark/readme/ROADMAP.rst +++ /dev/null @@ -1 +0,0 @@ -This module depends on support for transparent backgrounds in Wkhtmltopdf, which has been flaky in the past. This module has been reported to work with Wkhtmltopdf 0.12.4. diff --git a/report_qweb_pdf_watermark/readme/USAGE.md b/report_qweb_pdf_watermark/readme/USAGE.md new file mode 100644 index 000000000..3e6c269a7 --- /dev/null +++ b/report_qweb_pdf_watermark/readme/USAGE.md @@ -0,0 +1,23 @@ +To use this module, you need to: + +1. go to your report +2. select a PDF or image to use as watermark. Note that resolutions and + size must match, otherwise you'll have funny results +3. You can also fill in an expression that returns the data (base64 + encoded) to be used as watermark + +To use the Company watermark, you need to: + +1. go to settings --\> company --\> update info +2. upload an pdf watermark +3. go to settings --\> technical --\> reporting --\> reports +4. Select the report where you want to use it. +5. On the 'Advanced Properties' tab of the notebook check 'use company + watermark' + +\### Demo And demo report is available (if you have demo data installed) +on the users form view. + +1. go to Configuration --\> users +2. Select an users +3. Click the print button --\> Watermark Demo report. diff --git a/report_qweb_pdf_watermark/readme/USAGE.rst b/report_qweb_pdf_watermark/readme/USAGE.rst deleted file mode 100644 index a725032f1..000000000 --- a/report_qweb_pdf_watermark/readme/USAGE.rst +++ /dev/null @@ -1,20 +0,0 @@ -To use this module, you need to: - -#. go to your report -#. select a PDF or image to use as watermark. Note that resolutions and size must match, otherwise you'll have funny results -#. You can also fill in an expression that returns the data (base64 encoded) to be used as watermark - -To use the Company watermark, you need to: - -#. go to settings --> company --> update info -#. upload an pdf watermark -#. go to settings --> technical --> reporting --> reports -#. Select the report where you want to use it. -#. On the 'Advanced Properties' tab of the notebook check 'use company watermark' - -### Demo -And demo report is available (if you have demo data installed) on the users form view. - -#. go to Configuration --> users -#. Select an users -#. Click the print button --> Watermark Demo report. diff --git a/report_qweb_pdf_watermark/static/description/index.html b/report_qweb_pdf_watermark/static/description/index.html index 97a381e8b..bd1652870 100644 --- a/report_qweb_pdf_watermark/static/description/index.html +++ b/report_qweb_pdf_watermark/static/description/index.html @@ -369,8 +369,12 @@ ul.auto-toc { !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:2940fdc81ee124d4fef7eef00d6394463dddb5177a4996e6c5ffcb6a19b5734e !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Production/Stable License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

-

This module was written to add watermarks (backgrounds) to PDF reports. Because of the way wkhtmltopdf handles headers and footers in the current versions, it is quite impossible to have a background for the complete page using HTML and CSS. That is why this module inserts the image at the PDF level.

+

Production/Stable License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

+

This module was written to add watermarks (backgrounds) to PDF reports. +Because of the way wkhtmltopdf handles headers and footers in the +current versions, it is quite impossible to have a background for the +complete page using HTML and CSS. That is why this module inserts the +image at the PDF level.

Table of contents

    @@ -406,8 +410,10 @@ $ pip install pypdf2

    To use this module, you need to:

    1. go to your report
    2. -
    3. select a PDF or image to use as watermark. Note that resolutions and size must match, otherwise you’ll have funny results
    4. -
    5. You can also fill in an expression that returns the data (base64 encoded) to be used as watermark
    6. +
    7. select a PDF or image to use as watermark. Note that resolutions and +size must match, otherwise you’ll have funny results
    8. +
    9. You can also fill in an expression that returns the data (base64 +encoded) to be used as watermark

    To use the Company watermark, you need to:

      @@ -415,10 +421,11 @@ $ pip install pypdf2
    1. upload an pdf watermark
    2. go to settings –> technical –> reporting –> reports
    3. Select the report where you want to use it.
    4. -
    5. On the ‘Advanced Properties’ tab of the notebook check ‘use company watermark’
    6. +
    7. On the ‘Advanced Properties’ tab of the notebook check ‘use company +watermark’
    -

    ### Demo -And demo report is available (if you have demo data installed) on the users form view.

    +

    ### Demo And demo report is available (if you have demo data installed) +on the users form view.

    1. go to Configuration –> users
    2. Select an users
    3. @@ -427,7 +434,9 @@ And demo report is available (if you have demo data installed) on the users form

Known issues / Roadmap

-

This module depends on support for transparent backgrounds in Wkhtmltopdf, which has been flaky in the past. This module has been reported to work with Wkhtmltopdf 0.12.4.

+

This module depends on support for transparent backgrounds in +Wkhtmltopdf, which has been flaky in the past. This module has been +reported to work with Wkhtmltopdf 0.12.4.

Changelog

@@ -468,7 +477,7 @@ And demo report is available (if you have demo data installed) on the users form

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -498,7 +507,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/reporting-engine project on GitHub.

+

This module is part of the OCA/reporting-engine project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.