fix(sticker): bigger QR + larger body text + tighter Notes row

- QR generation bumped from 300x300 to 600x600 (down-scales at print
  time instead of up-scales — eliminates the pixelation that broke
  thermal-printer scans).
- QR display wrapper grew from 380->460px; the underlying image and
  quiet-zone crop scaled proportionally (510->620px image, offset
  -65->-80px).
- Header band 40%->44% so the bigger QR has room without crowding
  the logo / WO# stack.
- Body band 60%->56%. First 6 rows take 15% of the band each (~9.4mm
  printed — slightly taller than the prior equal-split 8.7mm despite
  the smaller band) and the Notes row drops to 10% (~6mm). Notes is
  usually one-line content on these stickers; main rows carry the
  PO / Customer / Process / Part / Due / Qty info that has to read
  well from across the shop.
- Body font 38pt->44pt, muted 28pt->32pt. Notes row uses 32pt so 1-2
  lines still fit in its trimmed height.

Verified: 123,668-byte PDF renders cleanly on entech (WO-30019).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-12 21:33:50 -04:00
parent 2737bc481c
commit d7bbeb49b7
2 changed files with 39 additions and 23 deletions

View File

@@ -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.10.3.0', 'version': '19.0.10.4.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': [

View File

@@ -70,9 +70,12 @@
and _so.x_fc_internal_note.striptags()[:100]) and _so.x_fc_internal_note.striptags()[:100])
or '-'"/> or '-'"/>
<!-- Inline the QR as base64 data URI so wkhtmltopdf doesn't need <!-- Inline the QR as base64 data URI so wkhtmltopdf doesn't need
to fetch /report/barcode/ over the network during rendering. --> to fetch /report/barcode/ over the network during rendering.
Generated at 600x600 (was 300x300) so it down-scales rather
than up-scales at print time — much sharper on Brother /
Zebra thermal printers where small QRs were dropping rows. -->
<t t-set="_qr_src" t-value="env['ir.actions.report'].barcode_data_uri( <t t-set="_qr_src" t-value="env['ir.actions.report'].barcode_data_uri(
'QR', _scan_url, width=300, height=300)"/> 'QR', _scan_url, width=600, height=600)"/>
<style> <style>
@page { margin: 0; size: 152mm 102mm; } @page { margin: 0; size: 152mm 102mm; }
@@ -97,11 +100,14 @@
page-break-after: always; page-break-after: always;
page-break-inside: avoid; page-break-inside: avoid;
} }
/* ---- HEADER band — grew to 40% to fit 2x WO# + logo + bigger QR. */ /* ---- HEADER band — grew to 44% (was 40%) to fit a bigger QR
for thermal-printer scan reliability. The body band is now
56% but each row stays roughly the same height because
we tightened the Notes row at the bottom. */
.fp-sticker-head-wrap { .fp-sticker-head-wrap {
position: absolute; position: absolute;
left: 0; right: 0; top: 0; left: 0; right: 0; top: 0;
height: 40%; height: 44%;
border-bottom: 2px solid #000; border-bottom: 2px solid #000;
box-sizing: border-box; box-sizing: border-box;
padding: 0; padding: 0;
@@ -168,26 +174,32 @@
render the image larger than the wrapper and offset it so render the image larger than the wrapper and offset it so
the wrapper clips that border out. ---------------------- */ the wrapper clips that border out. ---------------------- */
.fp-sticker-qr-wrap { .fp-sticker-qr-wrap {
width: 380px; width: 460px;
height: 380px; height: 460px;
display: inline-block; display: inline-block;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
.fp-sticker-qr { .fp-sticker-qr {
width: 510px; width: 620px;
height: 510px; height: 620px;
position: absolute; position: absolute;
top: -65px; top: -80px;
left: -65px; left: -80px;
margin: 0; margin: 0;
display: block; display: block;
} }
/* ---- BODY band (7 rows, each 14.28% of the band) ---- */ /* ---- BODY band — first 6 rows are equal-height; the
final Notes row takes less. Header moved down to 44%
so this band is 56%; the row-height split below brings
the 6 main rows to ~9.4mm each (slightly more than the
old equal-split 8.7mm despite the smaller band). Notes
drops to ~6mm — enough for 1-2 lines of the bigger
text below. ---- */
.fp-sticker-body-wrap { .fp-sticker-body-wrap {
position: absolute; position: absolute;
left: 0; right: 0; left: 0; right: 0;
top: 40%; bottom: 0; top: 44%; bottom: 0;
} }
table.fp-sticker-body { table.fp-sticker-body {
width: 100%; width: 100%;
@@ -195,14 +207,15 @@
table-layout: fixed; table-layout: fixed;
border-collapse: collapse; border-collapse: collapse;
} }
table.fp-sticker-body tr { height: 14.28%; } table.fp-sticker-body tr.fp-sticker-row-main { height: 15%; }
table.fp-sticker-body tr.fp-sticker-row-notes { height: 10%; }
table.fp-sticker-body tr + tr td { border-top: 1px solid #000; } table.fp-sticker-body tr + tr td { border-top: 1px solid #000; }
col.fp-col-label { width: 32%; } col.fp-col-label { width: 32%; }
col.fp-col-value { width: 68%; } col.fp-col-value { width: 68%; }
table.fp-sticker-body td { table.fp-sticker-body td {
vertical-align: middle; vertical-align: middle;
padding: 0 14px; padding: 0 14px;
font-size: 38pt; font-size: 44pt;
line-height: 1.1; line-height: 1.1;
} }
td.fp-sticker-label { td.fp-sticker-label {
@@ -217,7 +230,10 @@
white-space: nowrap; white-space: nowrap;
} }
.fp-sticker-strong { font-weight: 700; } .fp-sticker-strong { font-weight: 700; }
.fp-sticker-muted { color: #555; font-size: 28pt; } .fp-sticker-muted { color: #555; font-size: 32pt; }
/* Notes row uses a slightly smaller font so 1-2 lines fit
in the trimmed-down height. -------------------------- */
tr.fp-sticker-row-notes td { font-size: 32pt; }
</style> </style>
<div class="fp-sticker"> <div class="fp-sticker">
@@ -269,7 +285,7 @@
<col class="fp-col-label"/> <col class="fp-col-label"/>
<col class="fp-col-value"/> <col class="fp-col-value"/>
</colgroup> </colgroup>
<tr> <tr class="fp-sticker-row-main">
<td class="fp-sticker-label">PO (RO):</td> <td class="fp-sticker-label">PO (RO):</td>
<td class="fp-sticker-value"> <td class="fp-sticker-value">
<span class="fp-sticker-strong" <span class="fp-sticker-strong"
@@ -281,13 +297,13 @@
</t> </t>
</td> </td>
</tr> </tr>
<tr> <tr class="fp-sticker-row-main">
<td class="fp-sticker-label">Customer:</td> <td class="fp-sticker-label">Customer:</td>
<td class="fp-sticker-value"> <td class="fp-sticker-value">
<span t-esc="_partner_name"/> <span t-esc="_partner_name"/>
</td> </td>
</tr> </tr>
<tr> <tr class="fp-sticker-row-main">
<td class="fp-sticker-label">Process:</td> <td class="fp-sticker-label">Process:</td>
<td class="fp-sticker-value"> <td class="fp-sticker-value">
<t t-if="_process"> <t t-if="_process">
@@ -299,7 +315,7 @@
<t t-else="">-</t> <t t-else="">-</t>
</td> </td>
</tr> </tr>
<tr> <tr class="fp-sticker-row-main">
<td class="fp-sticker-label">Part Number:</td> <td class="fp-sticker-label">Part Number:</td>
<td class="fp-sticker-value"> <td class="fp-sticker-value">
<t t-if="_part"> <t t-if="_part">
@@ -323,7 +339,7 @@
<t t-else="">-</t> <t t-else="">-</t>
</td> </td>
</tr> </tr>
<tr> <tr class="fp-sticker-row-main">
<td class="fp-sticker-label">Due Date:</td> <td class="fp-sticker-label">Due Date:</td>
<td class="fp-sticker-value"> <td class="fp-sticker-value">
<t t-if="_due"> <t t-if="_due">
@@ -332,7 +348,7 @@
<t t-else="">-</t> <t t-else="">-</t>
</td> </td>
</tr> </tr>
<tr> <tr class="fp-sticker-row-main">
<td class="fp-sticker-label">Qty:</td> <td class="fp-sticker-label">Qty:</td>
<td class="fp-sticker-value"> <td class="fp-sticker-value">
<span class="fp-sticker-strong"> <span class="fp-sticker-strong">
@@ -340,7 +356,7 @@
</span> </span>
</td> </td>
</tr> </tr>
<tr> <tr class="fp-sticker-row-notes">
<td class="fp-sticker-label">Notes:</td> <td class="fp-sticker-label">Notes:</td>
<td class="fp-sticker-value"> <td class="fp-sticker-value">
<t t-esc="_internal_note"/> <t t-esc="_internal_note"/>