fix(reports): sticker PDF KeyError: 'quote' on fusion_pdf_preview path

The QR <img> src used `% quote(_scan_url)` to URL-encode the value,
but `quote` isn't always in the QWeb render context — particularly
on the fusion_pdf_preview / account render chains. Result:
KeyError: 'quote' when printing from the browser.

_scan_url is always base_url + '/fp/wo/<int>' — no characters that
need encoding. Replaced the % + quote() formatting with simple
string concatenation, dropping the quote dependency entirely.

Smoke verified on entech: MO + WO stickers render cleanly at 27KB
each (with QR image included).

fusion_plating_reports → 19.0.7.2.0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-23 10:58:24 -04:00
parent e32ff4b056
commit 0eab4b4efb
2 changed files with 6 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
# License OPL-1 (Odoo Proprietary License v1.0)
{
'name': 'Fusion Plating — Reports',
'version': '19.0.7.1.0',
'version': '19.0.7.2.0',
'category': 'Manufacturing/Plating',
'summary': 'PDF reports for Fusion Plating: quote, SO, WO, packing, BoL, CoC, invoice, receipt, quality + compliance.',
'depends': [

View File

@@ -146,8 +146,12 @@
</div>
</div>
<div class="fp-sticker-header-right">
<!-- _scan_url is always base_url + '/fp/wo/<int>' —
no characters that need URL encoding, so we can
drop the quote() call (which isn't in the QWeb
render context on every ir_actions_report path). -->
<img class="fp-sticker-qr"
t-att-src="'/report/barcode/?barcode_type=QR&amp;value=%s&amp;width=300&amp;height=300' % quote(_scan_url)"/>
t-att-src="'/report/barcode/?barcode_type=QR&amp;value=' + _scan_url + '&amp;width=300&amp;height=300'"/>
<div class="fp-sticker-qr-caption">scan to open</div>
</div>
</div>