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:
@@ -3,7 +3,7 @@
|
|||||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||||
{
|
{
|
||||||
'name': 'Fusion Plating — Reports',
|
'name': 'Fusion Plating — Reports',
|
||||||
'version': '19.0.7.1.0',
|
'version': '19.0.7.2.0',
|
||||||
'category': 'Manufacturing/Plating',
|
'category': 'Manufacturing/Plating',
|
||||||
'summary': 'PDF reports for Fusion Plating: quote, SO, WO, packing, BoL, CoC, invoice, receipt, quality + compliance.',
|
'summary': 'PDF reports for Fusion Plating: quote, SO, WO, packing, BoL, CoC, invoice, receipt, quality + compliance.',
|
||||||
'depends': [
|
'depends': [
|
||||||
|
|||||||
@@ -146,8 +146,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="fp-sticker-header-right">
|
<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"
|
<img class="fp-sticker-qr"
|
||||||
t-att-src="'/report/barcode/?barcode_type=QR&value=%s&width=300&height=300' % quote(_scan_url)"/>
|
t-att-src="'/report/barcode/?barcode_type=QR&value=' + _scan_url + '&width=300&height=300'"/>
|
||||||
<div class="fp-sticker-qr-caption">scan to open</div>
|
<div class="fp-sticker-qr-caption">scan to open</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user