Skip to content

Commit

Permalink
[MIG] report_qweb_pdf_watermark: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderlienaerts committed Jan 12, 2024
1 parent 18eb03d commit be99a94
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 21 deletions.
6 changes: 6 additions & 0 deletions report_qweb_pdf_watermark/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ Changelog

- [MIG] Migration to V16.

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

- [MIG] Migration to V17.

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

Expand Down Expand Up @@ -138,6 +143,7 @@ Contributors
- Robin Goots <[email protected]>
- Foram Shah <[email protected]>
- Emiel van Bokhoven <[email protected]>
- Sander Lienaerts <[email protected]>
- Anjeel Haria

Maintainers
Expand Down
2 changes: 1 addition & 1 deletion report_qweb_pdf_watermark/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Pdf watermark",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"author": "Therp BV, " "Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Technical Settings",
Expand Down
15 changes: 8 additions & 7 deletions report_qweb_pdf_watermark/models/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ class Report(models.Model):

def _render_qweb_pdf(self, report_ref, res_ids=None, data=None):
if not self.env.context.get("res_ids"):
return super(Report, self.with_context(res_ids=res_ids))._render_qweb_pdf(
report_ref, res_ids=res_ids, data=data
return (
super()
.with_context(res_ids=res_ids)
._render_qweb_pdf(report_ref, res_ids=res_ids, data=data)
)
return super(Report, self)._render_qweb_pdf(
report_ref, res_ids=res_ids, data=data
)
return super()._render_qweb_pdf(report_ref, res_ids=res_ids, data=data)

def pdf_has_usable_pages(self, numpages):
@staticmethod
def pdf_has_usable_pages(numpages):
if numpages < 1:
logger.error("Your watermark pdf does not contain any pages")
return False
Expand All @@ -73,7 +74,7 @@ def _run_wkhtmltopdf(
specific_paperformat_args=None,
set_viewport_size=False,
):
result = super(Report, self)._run_wkhtmltopdf(
result = super()._run_wkhtmltopdf(
bodies,
report_ref=report_ref,
header=header,
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 @@ -4,4 +4,5 @@
- Robin Goots \<<[email protected]>\>
- Foram Shah \<<[email protected]>\>
- Emiel van Bokhoven \<<[email protected]>\>
- Sander Lienaerts \<<[email protected]>\>
- Anjeel Haria
4 changes: 4 additions & 0 deletions report_qweb_pdf_watermark/readme/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
## 16.0.1.0.0 (2023-03-13)

- \[MIG\] Migration to V16.

## 17.0.1.0.0 (2024-01-12)

- \[MIG\] Migration to V17.
28 changes: 18 additions & 10 deletions report_qweb_pdf_watermark/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,14 @@ <h1 class="title">Pdf watermark</h1>
<li><a class="reference internal" href="#section-3" id="toc-entry-7">14.0.1.0.0 (2021-01-29)</a></li>
<li><a class="reference internal" href="#section-4" id="toc-entry-8">15.0.1.0.0 (2022-01-11)</a></li>
<li><a class="reference internal" href="#section-5" id="toc-entry-9">16.0.1.0.0 (2023-03-13)</a></li>
<li><a class="reference internal" href="#section-6" id="toc-entry-10">17.0.1.0.0 (2024-01-12)</a></li>
</ul>
</li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-10">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-11">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-12">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-13">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-14">Maintainers</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-11">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-12">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-13">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-14">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-15">Maintainers</a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -471,37 +472,44 @@ <h2><a class="toc-backref" href="#toc-entry-9">16.0.1.0.0 (2023-03-13)</a></h2>
<li>[MIG] Migration to V16.</li>
</ul>
</div>
<div class="section" id="section-6">
<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>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-10">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#toc-entry-11">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:%2017.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">
<h1><a class="toc-backref" href="#toc-entry-11">Credits</a></h1>
<h1><a class="toc-backref" href="#toc-entry-12">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-12">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-13">Authors</a></h2>
<ul class="simple">
<li>Therp BV</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-13">Contributors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-14">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>
<li>Rod Schouteden &lt;<a class="reference external" href="mailto:rod.schouteden&#64;dynapps.be">rod.schouteden&#64;dynapps.be</a>&gt;</li>
<li>Robin Goots &lt;<a class="reference external" href="mailto:robin.goots&#64;dynapps.be">robin.goots&#64;dynapps.be</a>&gt;</li>
<li>Foram Shah &lt;<a class="reference external" href="mailto:foram.shah&#64;initos.com">foram.shah&#64;initos.com</a>&gt;</li>
<li>Emiel van Bokhoven &lt;<a class="reference external" href="mailto:emiel&#64;360erp.nl">emiel&#64;360erp.nl</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>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-14">Maintainers</a></h2>
<h2><a class="toc-backref" href="#toc-entry-15">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" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
Expand Down
6 changes: 3 additions & 3 deletions report_qweb_pdf_watermark/views/ir_actions_report_xml.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
<field name="attachment" position="after">
<field
name="use_company_watermark"
attrs="{'invisible': [('report_type', '!=', 'qweb-pdf')]}"
invisible="report_type != 'qweb-pdf'"
/>
<field
name="pdf_watermark_expression"
attrs="{'invisible': ['|',('report_type', '!=', 'qweb-pdf'),('use_company_watermark', '=', True)]}"
invisible="report_type != 'qweb-pdf' or use_company_watermark"
groups="base.group_no_one"
/>
<field
name="pdf_watermark"
attrs="{'invisible': ['|',('report_type', '!=', 'qweb-pdf'),('use_company_watermark', '=', True)]}"
invisible="report_type != 'qweb-pdf' or use_company_watermark"
widget="pdf_viewer"
/>
</field>
Expand Down

0 comments on commit be99a94

Please sign in to comment.