fix(sticker): wire SN # + Thickness to the correct Sub 5 fields
The values were structurally blank because the variable
resolution was reading the wrong field names:
Was: _line.x_fc_serial_number (doesn't exist)
_line.x_fc_thickness (doesn't exist)
Now: _line.x_fc_serial_id.name (M2O fp.serial)
_line.x_fc_thickness_id.display_name (M2O fp.coating.thickness)
Sub 5 shipped these as Many2one registries (fp.serial,
fp.coating.thickness) — the sticker was guessing at flat
Char-field equivalents that were never created.
Verified on SO-30019: SN # now prints "65767", Thickness now
prints "0.3-0.5 mils" (the en-dash in display_name mojibakes
to "â€"" through wkhtmltopdf's font path on entech, so we
replace en-dash + em-dash with ASCII hyphen-minus before
render — ASCII-only is what label printers want anyway).
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.10.9.0',
|
'version': '19.0.10.11.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': [
|
||||||
|
|||||||
@@ -69,13 +69,17 @@
|
|||||||
or (_so and _so.x_fc_internal_note
|
or (_so and _so.x_fc_internal_note
|
||||||
and _so.x_fc_internal_note.striptags()[:100])
|
and _so.x_fc_internal_note.striptags()[:100])
|
||||||
or '-'"/>
|
or '-'"/>
|
||||||
<!-- Serial number — Sub 5 added x_fc_serial_number on the SO line. -->
|
<!-- Serial number — Sub 5 added x_fc_serial_id (M2O fp.serial) on
|
||||||
<t t-set="_serial_number" t-value="(_line and 'x_fc_serial_number' in _line._fields and _line.x_fc_serial_number) or '-'"/>
|
the SO line. The serial record's `name` is the printable label. -->
|
||||||
<!-- Thickness — Sub 5 added x_fc_thickness on the SO line; fall back
|
<t t-set="_serial_number" t-value="(_line and 'x_fc_serial_id' in _line._fields and _line.x_fc_serial_id and _line.x_fc_serial_id.name) or '-'"/>
|
||||||
to the coating config's thickness spec if the line is bare. -->
|
<!-- Thickness — Sub 5 added x_fc_thickness_id (M2O fp.coating.thickness)
|
||||||
<t t-set="_thickness" t-value="(_line and 'x_fc_thickness' in _line._fields and _line.x_fc_thickness)
|
on the SO line. `display_name` is the human-readable range, e.g.
|
||||||
or (_coating and 'thickness' in _coating._fields and _coating.thickness)
|
"0.3–0.5 mils". The en-dash (U+2013) in display_name mojibakes
|
||||||
or '-'"/>
|
to "â€"" through wkhtmltopdf's font path on entech, so we
|
||||||
|
swap en-dash + em-dash for a plain hyphen-minus before
|
||||||
|
rendering. ASCII-only printable for any QR-label printer. -->
|
||||||
|
<t t-set="_thickness_dn" t-value="_line and 'x_fc_thickness_id' in _line._fields and _line.x_fc_thickness_id and _line.x_fc_thickness_id.display_name"/>
|
||||||
|
<t t-set="_thickness" t-value="(_thickness_dn and _thickness_dn.replace(u'–', '-').replace(u'—', '-')) or '-'"/>
|
||||||
<!-- Notes content = customer-facing description. Per Sub 2 decision
|
<!-- Notes content = customer-facing description. Per Sub 2 decision
|
||||||
Q6: SO line `name` is the customer-facing description (Odoo
|
Q6: SO line `name` is the customer-facing description (Odoo
|
||||||
standard). Falls back to product name when the line is bare. -->
|
standard). Falls back to product name when the line is bare. -->
|
||||||
|
|||||||
Reference in New Issue
Block a user