Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
6c1c0c1
report_qweb_pdf_watermark (#86)
hbrunn Jan 9, 2017
9dfd968
OCA Transbot updated translations from Transifex
oca-transbot Jan 14, 2017
6e9f0b5
[MIG] report_qweb_pdf_watermark
StefanRijnhart Apr 22, 2017
540fefd
[ADD] Prioritize background transparency
StefanRijnhart Apr 24, 2017
74712c8
OCA Transbot updated translations from Transifex
oca-transbot Jun 3, 2017
1749b47
[FIX] Fix Watermark from PNG
etobella Jun 20, 2017
5862812
OCA Transbot updated translations from Transifex
oca-transbot Jul 1, 2017
765d9d4
[IMP] use PyPDF2 if possible
hbrunn Jun 8, 2017
2ac42c3
[UPD] build environment
hbrunn Jul 18, 2017
aacc2e3
fix test_report_qweb_signer - tests were causing travis to stall
JordiBForgeFlow Sep 14, 2017
c14c323
OCA Transbot updated translations from Transifex
oca-transbot Mar 3, 2018
ad06f6b
[FIX] Don't break printing some upstream reports with invalid models
StefanRijnhart Feb 28, 2018
869f858
[UPD] Update report_qweb_pdf_watermark.pot
oca-travis Jun 23, 2018
37e934e
[MIG] report_qweb_pdf_watermark: Migration to 11.0
schout-it Aug 16, 2018
0b5fc38
[UPD] Update report_qweb_pdf_watermark.pot
oca-travis Mar 15, 2019
19b611f
Update translation files
oca-transbot Mar 17, 2019
6cc10c4
[MIG] report_qweb_pdf_watermark: Migration to 12.0
robin5210 Nov 18, 2019
3be0067
[UPD] Update report_qweb_pdf_watermark.pot
oca-travis Jan 9, 2020
7a8b032
Update translation files
oca-transbot Jan 23, 2020
216469d
Update translation files
oca-transbot Aug 16, 2020
28fb259
[FIX] Fix 'installable' syntax in manifest file
mstuttgart Oct 9, 2020
43decdd
report_qweb_pdf_watermark 12.0.1.0.1
OCA-git-bot Oct 13, 2020
59e5aa7
[13.0][MIG] report_qweb_pdf_watermark
fshah-initos Jan 28, 2021
f320190
[IMP] report_qweb_pdf_watermark: black, isort, prettier
fshah-initos Jan 29, 2021
bb26747
[14.0][MIG] report_qweb_pdf_watermark
fshah-initos Jan 29, 2021
c072390
[UPD] Update report_qweb_pdf_watermark.pot
oca-travis Apr 14, 2021
dae5a93
[UPD] README.rst
OCA-git-bot Apr 14, 2021
2b39ef7
[REF] report_qweb_pdf_watermark: remove PyPDF2 from
fernandahf Jun 1, 2022
5075733
report_qweb_pdf_watermark 14.0.1.0.1
OCA-git-bot Jun 1, 2022
6c9f213
[MIG] report_qweb_pdf_watermark: Migration to 15.0
bosd Nov 1, 2022
fc623eb
[UPD] Update report_qweb_pdf_watermark.pot
Dec 29, 2022
06fd4b0
[UPD] README.rst
OCA-git-bot Dec 29, 2022
00badd4
Update translation files
weblate Dec 29, 2022
43264ca
[MIG] report_qweb_pdf_watermark: Migration to 16.0
bvanjeelharia Mar 13, 2023
7affee9
[UPD] Update report_qweb_pdf_watermark.pot
Apr 4, 2023
a0a2988
[UPD] README.rst
OCA-git-bot Apr 4, 2023
00761b6
Update translation files
weblate Apr 5, 2023
64c757c
[IMP] Avoiding ERROR in log with tests of report_qweb_pdf_watermark
BT-rmartin Aug 25, 2023
4f6b923
Translated using Weblate (Spanish)
Ivorra78 Aug 23, 2023
47cc9ec
[UPD] README.rst
OCA-git-bot Sep 3, 2023
45d87a9
[IMP] report_qweb_pdf_watermark: black, isort, prettier
sanderlienaerts Jan 12, 2024
74f9bdb
[MIG] report_qweb_pdf_watermark: Migration to 17.0
sanderlienaerts Jan 12, 2024
c0f739f
[UPD] Update report_qweb_pdf_watermark.pot
Nov 26, 2024
25bd455
[BOT] post-merge updates
OCA-git-bot Nov 26, 2024
2a267e7
Translated using Weblate (Italian)
mymage Nov 27, 2024
aa1651b
[IMP] report_qweb_pdf_watermark: pre-commit execution
bosd Jan 5, 2025
1ec1843
[MIG] report_qweb_pdf_watermark: Migration to 18.0
bosd Jan 5, 2025
e4ed4fe
[FIX] report_qweb_pdf_watermark: Recursion Error
bosd Jan 18, 2025
11adceb
[UPD] Update report_qweb_pdf_watermark.pot
Apr 1, 2025
2986d28
[BOT] post-merge updates
OCA-git-bot Apr 1, 2025
94d13e6
Added translation using Weblate (Dutch)
bosd Apr 1, 2025
810ca7e
Translated using Weblate (Turkish)
tsezgin Sep 11, 2025
462e505
[IMP] report_qweb_pdf_watermark: support pypdf >= 2.0
hbrunn Nov 27, 2024
4f60255
[ADD] hbrunn as maintainer
hbrunn Nov 27, 2024
661d432
[BOT] post-merge updates
OCA-git-bot Sep 26, 2025
1e83842
[IMP] report_qweb_pdf_watermark: pre-commit auto fixes
antoniodavid Nov 15, 2025
b495f62
[19.0][MIG] report_qweb_pdf_watermark: Migration to 19.0
antoniodavid Nov 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 182 additions & 0 deletions report_qweb_pdf_watermark/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=============
Pdf watermark
=============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:67cd4a7c02e1bcf8a39d1c22704f7749972ed21cfe1747eb66e450bad5bbc0bf
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
: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/19.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-19-0/reporting-engine-19-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=19.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.

**Table of contents**

.. contents::
:local:

Installation
============

As PyPDF is not supported in python3, you need to install PyPDF2:

::

$ pip install pypdf2

Usage
=====

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.

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.6.

Changelog
=========

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.

17.0.1.0.0 (2024-01-12)
-----------------------

- [MIG] Migration to V17.

18.0.1.0.0 (2025-01-06)
-----------------------

- [MIG] Migration to V18.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/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 <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_qweb_pdf_watermark%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* Therp BV

Contributors
------------

- Holger Brunn <[email protected]>
- Stefan Rijnhart <[email protected]>
- Rod Schouteden <[email protected]>
- Robin Goots <[email protected]>
- Foram Shah <[email protected]>
- bosd <[email protected]>
- Sander Lienaerts <[email protected]>
- Anjeel Haria
- Antonio Ruban <[email protected]>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

.. |maintainer-hbrunn| image:: https://github.com/hbrunn.png?size=40px
:target: https://github.com/hbrunn
:alt: hbrunn

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-hbrunn|

This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/19.0/report_qweb_pdf_watermark>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions report_qweb_pdf_watermark/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
25 changes: 25 additions & 0 deletions report_qweb_pdf_watermark/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Pdf watermark",
"version": "19.0.1.0.1",
"author": "Therp BV, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Technical Settings",
"development_status": "Production/Stable",
"summary": "Add watermarks to your QWEB PDF reports",
"website": "https://github.com/OCA/reporting-engine",
"depends": ["web"],
"maintainers": ["hbrunn"],
"data": [
"views/ir_actions_report_xml.xml",
"views/res_company.xml",
],
"assets": {
"web.report_assets_pdf": [
"/report_qweb_pdf_watermark/static/src/css/report_qweb_pdf_watermark.css"
],
},
"demo": ["demo/report.xml"],
"installable": True,
}
26 changes: 26 additions & 0 deletions report_qweb_pdf_watermark/demo/report.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="demo_report" model="ir.actions.report">
<field name="name">Watermark Demo report</field>
<field name="model">res.users</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">report_qweb_pdf_watermark.demo_report_view</field>
<field name="report_file">report_qweb_pdf_watermark.demo_report_view</field>
<field name="pdf_watermark_expression">docs[:1].company_id.logo</field>
<field name="binding_model_id" ref="base.model_res_users" />
<field name="binding_type">report</field>
</record>
<template id="demo_report_view">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<div class="page">
<ul>
<li t-foreach="docs" t-as="doc">
<t t-esc="doc.name" />
</li>
</ul>
</div>
</t>
</t>
</template>
</odoo>
75 changes: 75 additions & 0 deletions report_qweb_pdf_watermark/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_qweb_pdf_watermark
#
# Translators:
# Carles Antoli <[email protected]>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-10 03:40+0000\n"
"PO-Revision-Date: 2017-01-10 03:40+0000\n"
"Last-Translator: Carles Antoli <[email protected]>, 2017\n"
"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: report_qweb_pdf_watermark
#: model:ir.model.fields,help:report_qweb_pdf_watermark.field_ir_actions_report__pdf_watermark_expression
msgid ""
"An expression yielding the base64 encoded data to be used as watermark. \n"
"You have access to variables `env` and `docs`"
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.model,name:report_qweb_pdf_watermark.model_res_company
msgid "Companies"
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.model,name:report_qweb_pdf_watermark.model_ir_actions_report
#, fuzzy
msgid "Report Action"
msgstr "Informe"

#. module: report_qweb_pdf_watermark
#: model_terms:ir.ui.view,arch_db:report_qweb_pdf_watermark.view_company_form
msgid ""
"Upload an pdf file to use as an Company watermark. You need to activate the "
"setting 'use company watermark' on the reports where you want to use it."
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.model.fields,help:report_qweb_pdf_watermark.field_ir_actions_report__pdf_watermark
msgid "Upload an pdf file to use as an watermark on this report."
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.model.fields,field_description:report_qweb_pdf_watermark.field_ir_actions_report__use_company_watermark
msgid "Use Company Watermark"
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.model.fields,help:report_qweb_pdf_watermark.field_ir_actions_report__use_company_watermark
msgid "Use the pdf watermark defined globally in the company settings."
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.model.fields,field_description:report_qweb_pdf_watermark.field_ir_actions_report__pdf_watermark
#: model:ir.model.fields,field_description:report_qweb_pdf_watermark.field_res_company__pdf_watermark
msgid "Watermark"
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.actions.report,name:report_qweb_pdf_watermark.demo_report
msgid "Watermark Demo report"
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.model.fields,field_description:report_qweb_pdf_watermark.field_ir_actions_report__pdf_watermark_expression
msgid "Watermark expression"
msgstr ""
75 changes: 75 additions & 0 deletions report_qweb_pdf_watermark/i18n/da.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_qweb_pdf_watermark
#
# Translators:
# Hans Henrik Gabelgaard <[email protected]>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-10 03:40+0000\n"
"PO-Revision-Date: 2017-01-10 03:40+0000\n"
"Last-Translator: Hans Henrik Gabelgaard <[email protected]>, 2017\n"
"Language-Team: Danish (https://www.transifex.com/oca/teams/23907/da/)\n"
"Language: da\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: report_qweb_pdf_watermark
#: model:ir.model.fields,help:report_qweb_pdf_watermark.field_ir_actions_report__pdf_watermark_expression
msgid ""
"An expression yielding the base64 encoded data to be used as watermark. \n"
"You have access to variables `env` and `docs`"
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.model,name:report_qweb_pdf_watermark.model_res_company
msgid "Companies"
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.model,name:report_qweb_pdf_watermark.model_ir_actions_report
#, fuzzy
msgid "Report Action"
msgstr "Rapport"

#. module: report_qweb_pdf_watermark
#: model_terms:ir.ui.view,arch_db:report_qweb_pdf_watermark.view_company_form
msgid ""
"Upload an pdf file to use as an Company watermark. You need to activate the "
"setting 'use company watermark' on the reports where you want to use it."
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.model.fields,help:report_qweb_pdf_watermark.field_ir_actions_report__pdf_watermark
msgid "Upload an pdf file to use as an watermark on this report."
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.model.fields,field_description:report_qweb_pdf_watermark.field_ir_actions_report__use_company_watermark
msgid "Use Company Watermark"
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.model.fields,help:report_qweb_pdf_watermark.field_ir_actions_report__use_company_watermark
msgid "Use the pdf watermark defined globally in the company settings."
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.model.fields,field_description:report_qweb_pdf_watermark.field_ir_actions_report__pdf_watermark
#: model:ir.model.fields,field_description:report_qweb_pdf_watermark.field_res_company__pdf_watermark
msgid "Watermark"
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.actions.report,name:report_qweb_pdf_watermark.demo_report
msgid "Watermark Demo report"
msgstr ""

#. module: report_qweb_pdf_watermark
#: model:ir.model.fields,field_description:report_qweb_pdf_watermark.field_ir_actions_report__pdf_watermark_expression
msgid "Watermark expression"
msgstr ""
Loading