Browse Source
Merge pull request #197 from StefanRijnhart/fix/10.0/report_qweb_pdf_watermark/invalid_report_models
[FIX] Don't break printing some upstream reports with invalid models
pull/201/head
Pedro M. Baeza
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
3 deletions
-
report_qweb_pdf_watermark/__manifest__.py
-
report_qweb_pdf_watermark/models/report.py
|
|
@ -3,7 +3,7 @@ |
|
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|
|
|
{ |
|
|
|
"name": "Pdf watermark", |
|
|
|
"version": "10.0.1.0.1", |
|
|
|
"version": "10.0.1.0.2", |
|
|
|
"author": "Therp BV, " |
|
|
|
"Odoo Community Association (OCA)", |
|
|
|
"license": "AGPL-3", |
|
|
|
|
|
@ -34,9 +34,9 @@ class Report(models.Model): |
|
|
|
watermark = None |
|
|
|
if report.pdf_watermark: |
|
|
|
watermark = b64decode(report.pdf_watermark) |
|
|
|
else: |
|
|
|
elif report.pdf_watermark_expression: |
|
|
|
watermark = tools.safe_eval( |
|
|
|
report.pdf_watermark_expression or 'None', |
|
|
|
report.pdf_watermark_expression, |
|
|
|
dict(env=self.env, docs=self.env[report.model].browse(docids)), |
|
|
|
) |
|
|
|
if watermark: |
|
|
|