Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 2 additions & 5 deletions report_qweb_pdf_watermark/README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=============
Pdf watermark
=============
Expand All @@ -17,7 +13,7 @@ Pdf watermark
.. |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
.. |badge2| image:: https://img.shields.io/badge/licence-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
Expand Down Expand Up @@ -154,6 +150,7 @@ Contributors
- bosd <c5e2fd43-d292-4c90-9d1f-74ff3436329a@anonaddy.me>
- Sander Lienaerts <sander.lienaerts@codeforward.nl>
- Anjeel Haria
- Dennis Sluijk <d.sluijk@onestein.nl>

Maintainers
-----------
Expand Down
1 change: 1 addition & 0 deletions report_qweb_pdf_watermark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
from . import wizards
1 change: 1 addition & 0 deletions report_qweb_pdf_watermark/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"data": [
"views/ir_actions_report_xml.xml",
"views/res_company.xml",
"wizards/base_document_layout.xml",
],
"assets": {
"web.report_assets_pdf": [
Expand Down
1 change: 1 addition & 0 deletions report_qweb_pdf_watermark/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
- bosd \<<c5e2fd43-d292-4c90-9d1f-74ff3436329a@anonaddy.me>\>
- Sander Lienaerts \<<sander.lienaerts@codeforward.nl>\>
- Anjeel Haria
- Dennis Sluijk \<<d.sluijk@onestein.nl>\>
47 changes: 21 additions & 26 deletions report_qweb_pdf_watermark/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>README.rst</title>
<title>Pdf watermark</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,21 +360,16 @@
</style>
</head>
<body>
<div class="document">
<div class="document" id="pdf-watermark">
<h1 class="title">Pdf watermark</h1>


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="pdf-watermark">
<h1>Pdf watermark</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:67cd4a7c02e1bcf8a39d1c22704f7749972ed21cfe1747eb66e450bad5bbc0bf
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/reporting-engine/tree/18.0/report_qweb_pdf_watermark"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-report_qweb_pdf_watermark"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/reporting-engine/tree/18.0/report_qweb_pdf_watermark"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-report_qweb_pdf_watermark"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>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
Expand Down Expand Up @@ -406,14 +401,14 @@ <h1>Pdf watermark</h1>
</ul>
</div>
<div class="section" id="installation">
<h2><a class="toc-backref" href="#toc-entry-1">Installation</a></h2>
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
<p>As PyPDF is not supported in python3, you need to install PyPDF2:</p>
<pre class="literal-block">
$ pip install pypdf2
</pre>
</div>
<div class="section" id="usage">
<h2><a class="toc-backref" href="#toc-entry-2">Usage</a></h2>
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<p>To use this module, you need to:</p>
<ol class="arabic simple">
<li>go to your report</li>
Expand All @@ -440,75 +435,75 @@ <h2><a class="toc-backref" href="#toc-entry-2">Usage</a></h2>
</ol>
</div>
<div class="section" id="known-issues-roadmap">
<h2><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h2>
<h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
<p>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.</p>
</div>
<div class="section" id="changelog">
<h2><a class="toc-backref" href="#toc-entry-4">Changelog</a></h2>
<h1><a class="toc-backref" href="#toc-entry-4">Changelog</a></h1>
<div class="section" id="section-1">
<h3><a class="toc-backref" href="#toc-entry-5">12.0.1.0.0 (2019-11-18)</a></h3>
<h2><a class="toc-backref" href="#toc-entry-5">12.0.1.0.0 (2019-11-18)</a></h2>
<ul class="simple">
<li>[MIG] Migration to V12.</li>
</ul>
</div>
<div class="section" id="section-2">
<h3><a class="toc-backref" href="#toc-entry-6">13.0.1.0.0 (2021-01-27)</a></h3>
<h2><a class="toc-backref" href="#toc-entry-6">13.0.1.0.0 (2021-01-27)</a></h2>
<ul class="simple">
<li>[MIG] Migration to V13.</li>
</ul>
</div>
<div class="section" id="section-3">
<h3><a class="toc-backref" href="#toc-entry-7">14.0.1.0.0 (2021-01-29)</a></h3>
<h2><a class="toc-backref" href="#toc-entry-7">14.0.1.0.0 (2021-01-29)</a></h2>
<ul class="simple">
<li>[MIG] Migration to V14.</li>
</ul>
</div>
<div class="section" id="section-4">
<h3><a class="toc-backref" href="#toc-entry-8">15.0.1.0.0 (2022-01-11)</a></h3>
<h2><a class="toc-backref" href="#toc-entry-8">15.0.1.0.0 (2022-01-11)</a></h2>
<ul class="simple">
<li>[MIG] Migration to V15.</li>
<li>Define pdf watermark in company settings</li>
</ul>
</div>
<div class="section" id="section-5">
<h3><a class="toc-backref" href="#toc-entry-9">16.0.1.0.0 (2023-03-13)</a></h3>
<h2><a class="toc-backref" href="#toc-entry-9">16.0.1.0.0 (2023-03-13)</a></h2>
<ul class="simple">
<li>[MIG] Migration to V16.</li>
</ul>
</div>
<div class="section" id="section-6">
<h3><a class="toc-backref" href="#toc-entry-10">17.0.1.0.0 (2024-01-12)</a></h3>
<h2><a class="toc-backref" href="#toc-entry-10">17.0.1.0.0 (2024-01-12)</a></h2>
<ul class="simple">
<li>[MIG] Migration to V17.</li>
</ul>
</div>
<div class="section" id="section-7">
<h3><a class="toc-backref" href="#toc-entry-11">18.0.1.0.0 (2025-01-06)</a></h3>
<h2><a class="toc-backref" href="#toc-entry-11">18.0.1.0.0 (2025-01-06)</a></h2>
<ul class="simple">
<li>[MIG] Migration to V18.</li>
</ul>
</div>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-12">Bug Tracker</a></h2>
<h1><a class="toc-backref" href="#toc-entry-12">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/reporting-engine/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_qweb_pdf_watermark%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#toc-entry-13">Credits</a></h2>
<h1><a class="toc-backref" href="#toc-entry-13">Credits</a></h1>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-14">Authors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-14">Authors</a></h2>
<ul class="simple">
<li>Therp BV</li>
</ul>
</div>
<div class="section" id="contributors">
<h3><a class="toc-backref" href="#toc-entry-15">Contributors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-15">Contributors</a></h2>
<ul class="simple">
<li>Holger Brunn &lt;<a class="reference external" href="mailto:hbrunn&#64;therp.nl">hbrunn&#64;therp.nl</a>&gt;</li>
<li>Stefan Rijnhart &lt;<a class="reference external" href="mailto:stefan&#64;opener.am">stefan&#64;opener.am</a>&gt;</li>
Expand All @@ -518,10 +513,11 @@ <h3><a class="toc-backref" href="#toc-entry-15">Contributors</a></h3>
<li>bosd &lt;<a class="reference external" href="mailto:c5e2fd43-d292-4c90-9d1f-74ff3436329a&#64;anonaddy.me">c5e2fd43-d292-4c90-9d1f-74ff3436329a&#64;anonaddy.me</a>&gt;</li>
<li>Sander Lienaerts &lt;<a class="reference external" href="mailto:sander.lienaerts&#64;codeforward.nl">sander.lienaerts&#64;codeforward.nl</a>&gt;</li>
<li>Anjeel Haria</li>
<li>Dennis Sluijk &lt;<a class="reference external" href="mailto:d.sluijk&#64;onestein.nl">d.sluijk&#64;onestein.nl</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-16">Maintainers</a></h3>
<h2><a class="toc-backref" href="#toc-entry-16">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand All @@ -536,6 +532,5 @@ <h3><a class="toc-backref" href="#toc-entry-16">Maintainers</a></h3>
</div>
</div>
</div>
</div>
</body>
</html>
4 changes: 4 additions & 0 deletions report_qweb_pdf_watermark/views/ir_actions_report_xml.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
</field>
</field>
</record>

<record id="web.action_report_externalpreview" model="ir.actions.report">
<field name="use_company_watermark" eval="True" />
</record>
</odoo>
1 change: 1 addition & 0 deletions report_qweb_pdf_watermark/wizards/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import base_document_layout
9 changes: 9 additions & 0 deletions report_qweb_pdf_watermark/wizards/base_document_layout.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from odoo import fields, models


class BaseDocumentLayout(models.TransientModel):
_inherit = "base.document.layout"

pdf_watermark = fields.Binary(
"Watermark", related="company_id.pdf_watermark", readonly=False
)
21 changes: 21 additions & 0 deletions report_qweb_pdf_watermark/wizards/base_document_layout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_base_document_layout" model="ir.ui.view">
<field name="model">base.document.layout</field>
<field name="inherit_id" ref="web.view_base_document_layout" />
<field name="arch" type="xml">
<xpath expr="//field[@name='layout_background']" position="after">
<field name="pdf_watermark" widget="pdf_viewer" />
<div
role="alert"
class="alert alert-info"
invisible="not pdf_watermark"
>
Note that the watermark is not reflected in the preview to the right.
Use the <b
>Preview Document</b> button to see the watermark in the generated PDF.
</div>
</xpath>
</field>
</record>
</odoo>
Loading