feat(fusion_plating_jobs): external sticker — prominent thickness banner + strip degree mojibake
- Relocate plating thickness out of the cramped rail (where it shared a row with Due and wrapped) to a big 21pt "PLATING THICKNESS" banner at the top of the main panel — the team's most-watched spec, now hard to miss. Gated on a new has_thk flag (real value with a digit; skips empty/'N/A'). Due takes the full rail row. - Fix the bake-text degree mojibake: operators type 'º' (U+00BA) for "375ºF"; through this sticker's lightweight html_container path (no .article UTF-8 wrapper) it renders "375°F". Adding a .article wrapper fixes encoding but blows up the dpi=96 mm layout (tested), so _clean() now strips º/°/˚ to clean ASCII -> "375F". Verified on entech (WO-30094). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,13 @@ def _clean(text):
|
|||||||
t = str(text)
|
t = str(text)
|
||||||
for a, b in ((u'—', '-'), (u'–', '-'), (u'‘', "'"),
|
for a, b in ((u'—', '-'), (u'–', '-'), (u'‘', "'"),
|
||||||
(u'’', "'"), (u'“', '"'), (u'”', '"'),
|
(u'’', "'"), (u'“', '"'), (u'”', '"'),
|
||||||
(u'…', '...')):
|
(u'…', '...'),
|
||||||
|
# Degree symbols: the masculine-ordinal 'º' (U+00BA) operators
|
||||||
|
# type for "375ºF", the real degree '°' (U+00B0), and the ring
|
||||||
|
# '˚' ALL mojibake to "°"/"º" through this sticker's lightweight
|
||||||
|
# html_container path (no .article UTF-8 wrapper — and adding one
|
||||||
|
# blows up the dpi=96 mm layout). Strip to clean ASCII: "375F".
|
||||||
|
(u'º', ''), (u'°', ''), (u'˚', '')):
|
||||||
t = t.replace(a, b)
|
t = t.replace(a, b)
|
||||||
return t.strip()
|
return t.strip()
|
||||||
|
|
||||||
@@ -88,6 +94,9 @@ class FpJob(models.Model):
|
|||||||
'qty': qty,
|
'qty': qty,
|
||||||
'due': due_s,
|
'due': due_s,
|
||||||
'thk': thk,
|
'thk': thk,
|
||||||
|
# Real thickness present (has a digit) — drives the prominent
|
||||||
|
# THICKNESS banner; skips empty / 'N/A' / '-' placeholders.
|
||||||
|
'has_thk': bool(thk and any(c.isdigit() for c in thk)),
|
||||||
'mask': bool(line and 'x_fc_masking_enabled' in line._fields and line.x_fc_masking_enabled),
|
'mask': bool(line and 'x_fc_masking_enabled' in line._fields and line.x_fc_masking_enabled),
|
||||||
'bake': _clean(line.x_fc_bake_instructions) if (line and 'x_fc_bake_instructions' in line._fields) else '',
|
'bake': _clean(line.x_fc_bake_instructions) if (line and 'x_fc_bake_instructions' in line._fields) else '',
|
||||||
'internal_notes': _clean(line.x_fc_internal_description) if (line and 'x_fc_internal_description' in line._fields) else '',
|
'internal_notes': _clean(line.x_fc_internal_description) if (line and 'x_fc_internal_description' in line._fields) else '',
|
||||||
|
|||||||
@@ -115,6 +115,7 @@
|
|||||||
.r-fld { padding: 0.7mm 2.2mm; }
|
.r-fld { padding: 0.7mm 2.2mm; }
|
||||||
.gtbl { border-collapse: collapse; width: 100%; height: 100%; }
|
.gtbl { border-collapse: collapse; width: 100%; height: 100%; }
|
||||||
.gtbl td { padding: 1mm 2.2mm; vertical-align: middle; }
|
.gtbl td { padding: 1mm 2.2mm; vertical-align: middle; }
|
||||||
|
.m-thk { padding: 1.8mm 2.6mm 2.4mm; }
|
||||||
.m-bake { padding: 1.3mm 2.6mm 1.8mm; }
|
.m-bake { padding: 1.3mm 2.6mm 1.8mm; }
|
||||||
.m-notes { padding: 1.3mm 2.6mm 3.5mm; }
|
.m-notes { padding: 1.3mm 2.6mm 3.5mm; }
|
||||||
</style>
|
</style>
|
||||||
@@ -233,11 +234,18 @@
|
|||||||
<td><span class="lbl">Qty</span><span style="font-size:11pt;font-weight:900;display:block"><t t-esc="d['qty']"/></span></td>
|
<td><span class="lbl">Qty</span><span style="font-size:11pt;font-weight:900;display:block"><t t-esc="d['qty']"/></span></td>
|
||||||
</tr></table></div>
|
</tr></table></div>
|
||||||
<div style="height:8.5mm"><table class="gtbl"><tr>
|
<div style="height:8.5mm"><table class="gtbl"><tr>
|
||||||
<td class="vrule" style="width:55%"><span class="lbl">Due</span><span style="font-size:9pt;font-weight:bold;display:block"><t t-esc="d['due'] or '-'"/></span></td>
|
<td><span class="lbl">Due</span><span style="font-size:11pt;font-weight:bold;display:block"><t t-esc="d['due'] or '-'"/></span></td>
|
||||||
<td><span class="lbl">Thk (mils)</span><span style="font-size:8.5pt;font-weight:bold;display:block"><t t-esc="d['thk'] or '-'"/></span></td>
|
|
||||||
</tr></table></div>
|
</tr></table></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
|
<!-- Plating thickness — the team's most-watched spec. Relocated
|
||||||
|
out of the cramped rail to a prominent full-width banner at
|
||||||
|
the top of the main panel. -->
|
||||||
|
<t t-if="d['has_thk']">
|
||||||
|
<div class="m-thk rule"><span class="inshead">PLATING THICKNESS</span>
|
||||||
|
<div style="font-size:21pt;font-weight:900;line-height:1;margin-top:1.4mm"><t t-esc="d['thk']"/></div>
|
||||||
|
</div>
|
||||||
|
</t>
|
||||||
<t t-if="d['bake']">
|
<t t-if="d['bake']">
|
||||||
<div class="m-bake rule"><span class="inshead">BAKE</span>
|
<div class="m-bake rule"><span class="inshead">BAKE</span>
|
||||||
<div class="instext" style="font-size:10pt;line-height:1.22;margin-top:1mm"><t t-esc="d['bake']"/></div>
|
<div class="instext" style="font-size:10pt;line-height:1.22;margin-top:1mm"><t t-esc="d['bake']"/></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user