fix(reports+configurator): clean description, recipe propagation, uppercase rendering
H1 — Recipe propagation hardening for multi-part orders. The G3 onchange fires when material_process changes, but a newly-added line (especially via inline part create) sometimes didn't pick up the recipe before confirm. In action_create_order, just BEFORE building so_vals, force line.process_variant_id = wizard.material_process if the line is missing one. Also added the same fallback inside the so_vals dict so the SO line always carries the right recipe even if the wizard line missed it. H2 — Strip 'spec - PART Rev X (xN)' header from customer-facing description. Per user feedback, the customer-facing reports (SO confirmation, Invoice, CoC, packing slip, BoL) should show ONLY the typed description + thickness in the Description column. The legacy header that prepended part metadata to line.name duplicated info from the Part Number column. Wizard now writes ONLY the customer description to line.name; the Part Number column owns the part-rev-name display. H3 — Uppercase customer-facing description in reports. The shared customer_line_description macro now wraps the description, serial, and thickness in text-transform: uppercase divs. All reports that use the macro (SO confirmation, Invoice, CoC, packing slip, BoL) get the caps treatment automatically. Non-part lines (freight, rush fees) keep their natural casing. Manually cleaned up DOD-00154/SO-30062: - Backfilled line 682 with the header recipe (ENP ALUM BASIC HP) - Stripped the legacy 'No spec - PART Rev (xN)' header from both lines' names; descriptions now read 'THIS IS TEST SPECIFICATIONS...' and 'THIS IS BLB ABLA BOLL' cleanly.
This commit is contained in:
@@ -77,35 +77,37 @@
|
||||
========================================================== -->
|
||||
<template id="customer_line_description">
|
||||
<t t-if="line.x_fc_part_catalog_id">
|
||||
<!-- Strip the "[FP-SERVICE] Plating Service" prefix Odoo's
|
||||
_compute_name keeps re-prepending. fp_customer_description
|
||||
lives on sale.order.line + account.move.line; for any
|
||||
other model the macro might be called with we degrade to
|
||||
raw line.name. QWeb's eval context doesn't expose Python
|
||||
builtins like hasattr/getattr, so probe the model's method
|
||||
dict via line._name + env. white-space: pre-line preserves
|
||||
the estimator's line breaks. -->
|
||||
<!-- Customer-facing description column (2026-05-27 rebuild).
|
||||
Per user request:
|
||||
- Only the description and thickness print
|
||||
- Both rendered in CAPITAL LETTERS via CSS
|
||||
The "spec - PART (xN)" header that used to prefix
|
||||
line.name has been removed at the wizard side; this
|
||||
macro just renders the cleaned description.
|
||||
white-space: pre-line preserves multi-line breaks. -->
|
||||
<t t-set="_has_helper"
|
||||
t-value="line._name in ('sale.order.line', 'account.move.line')"/>
|
||||
<t t-set="_desc"
|
||||
t-value="line.fp_customer_description() if _has_helper else line.name"/>
|
||||
<span t-esc="_desc" style="white-space: pre-line;"/>
|
||||
<div style="text-transform: uppercase; white-space: pre-line; font-weight: 500;">
|
||||
<t t-esc="_desc"/>
|
||||
</div>
|
||||
<!-- Serial line is suppressed when the calling template sets
|
||||
`fp_no_serial_in_desc=True` in `line.env.context`. SO
|
||||
portrait does this because it shows the serial in its own
|
||||
column in the part-number cell — otherwise it'd be
|
||||
duplicated. Invoice / packing slip still display it here. -->
|
||||
`fp_no_serial_in_desc=True` (SO portrait shows S/N in its
|
||||
own column). Invoice / packing slip still display it here. -->
|
||||
<t t-if="'x_fc_serial_id' in line._fields and line.x_fc_serial_id and not line.env.context.get('fp_no_serial_in_desc')">
|
||||
<br/>
|
||||
<small>Serial: <span t-esc="line.x_fc_serial_id.name"/></small>
|
||||
<div style="text-transform: uppercase; margin-top: 4px;">
|
||||
<small>SERIAL: <span t-esc="line.x_fc_serial_id.name"/></small>
|
||||
</div>
|
||||
</t>
|
||||
<t t-if="'x_fc_thickness_range' in line._fields and line.x_fc_thickness_range">
|
||||
<br/>
|
||||
<small>Thickness: <span t-esc="line.x_fc_thickness_range"/></small>
|
||||
<div style="text-transform: uppercase; margin-top: 4px;">
|
||||
<small>THICKNESS: <span t-esc="line.x_fc_thickness_range"/></small>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<!-- Fee / freight / non-part line: standard Odoo rendering -->
|
||||
<!-- Fee / freight / non-part line: standard Odoo rendering, not uppercased -->
|
||||
<strong t-esc="line.product_id.display_name or ''"/>
|
||||
<t t-if="line.name and line.name != line.product_id.display_name">
|
||||
<br/>
|
||||
|
||||
Reference in New Issue
Block a user