feat(reports): traveler PDF surfaces part_number + internal description (Sub 2 Task 23)

This commit is contained in:
gsinghpal
2026-04-21 23:19:33 -04:00
parent 84c0745ab5
commit 20d547bb4f

View File

@@ -84,8 +84,20 @@
<tr>
<th class="info-header">Part Number</th>
<td>
<t t-if="so and so.x_fc_part_catalog_id">
<span t-field="so.x_fc_part_catalog_id.name"/>
<!-- Sub 2: prefer the linked part catalog (part_number + rev);
fall back to SO-level catalog ref, then product default_code. -->
<t t-set="_line" t-value="(mo.x_fc_sale_order_line_ids.filtered(lambda l: l.product_id == mo.product_id)[:1] or mo.x_fc_sale_order_line_ids[:1]) if 'x_fc_sale_order_line_ids' in mo._fields else mo.env['sale.order.line']"/>
<t t-if="(not _line) and so">
<t t-set="_line" t-value="so.order_line.filtered(lambda l: l.product_id == mo.product_id)[:1] or so.order_line[:1]"/>
</t>
<t t-set="_part" t-value="(_line.x_fc_part_catalog_id if (_line and 'x_fc_part_catalog_id' in _line._fields) else False) or (so.x_fc_part_catalog_id if so else False)"/>
<t t-if="_part">
<strong>
<span t-esc="_part.part_number or _part.name"/>
<t t-if="_part.revision">
<span> (Rev <span t-esc="_part.revision"/>)</span>
</t>
</strong>
</t>
<t t-else=""><span t-field="mo.product_id.default_code"/></t>
</td>
@@ -139,6 +151,38 @@
</tbody>
</table>
<!-- ===== 1b. PART DESCRIPTIONS (Sub 2) — internal report keeps the service
SKU visible while surfacing customer-facing + internal workflow text. -->
<t t-set="_trav_line" t-value="(mo.x_fc_sale_order_line_ids.filtered(lambda l: l.product_id == mo.product_id)[:1] or mo.x_fc_sale_order_line_ids[:1]) if 'x_fc_sale_order_line_ids' in mo._fields else mo.env['sale.order.line']"/>
<t t-if="(not _trav_line) and so">
<t t-set="_trav_line" t-value="so.order_line.filtered(lambda l: l.product_id == mo.product_id)[:1] or so.order_line[:1]"/>
</t>
<table class="bordered">
<thead>
<tr><th colspan="4" class="fp-header-primary">PART DESCRIPTIONS</th></tr>
</thead>
<tbody>
<tr>
<th class="info-header" style="width: 20%;">Customer-Facing Description</th>
<td style="width: 40%;">
<t t-if="_trav_line"><span t-esc="_trav_line.name or '—'"/></t>
<t t-else=""></t>
</td>
<th class="info-header" style="width: 15%;">Service SKU</th>
<td style="width: 25%;"><span t-esc="mo.product_id.default_code or '—'"/></td>
</tr>
<tr>
<th class="info-header">Internal Description / Workflow</th>
<td colspan="3">
<t t-if="_trav_line and 'x_fc_internal_description' in _trav_line._fields and _trav_line.x_fc_internal_description">
<span t-esc="_trav_line.x_fc_internal_description" style="white-space: pre-wrap;"/>
</t>
<t t-else=""></t>
</td>
</tr>
</tbody>
</table>
<!-- ===== 2. RECEIVING ===== -->
<table class="bordered">
<thead>