feat(reports): WO PDF surfaces part_number + internal description (Sub 2 Task 22)
This commit is contained in:
@@ -65,6 +65,59 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- Sub 2: Part number + dual descriptions (internal report).
|
||||
Operators still see the service SKU under PRODUCT above.
|
||||
Resolves the sale.order.line via the MO's tagged source
|
||||
lines (x_fc_sale_order_line_ids), falling back to the
|
||||
SO's first line that matches this WO's product. -->
|
||||
<t t-set="_mo" t-value="doc.production_id"/>
|
||||
<t t-set="_so_lines" t-value="_mo.x_fc_sale_order_line_ids if 'x_fc_sale_order_line_ids' in _mo._fields else _mo.env['sale.order.line']"/>
|
||||
<t t-set="_line" t-value="_so_lines.filtered(lambda l: l.product_id == doc.product_id)[:1] or _so_lines[:1]"/>
|
||||
<t t-if="(not _line) and doc.x_fc_sale_order_id">
|
||||
<t t-set="_line" t-value="doc.x_fc_sale_order_id.order_line.filtered(lambda l: l.product_id == doc.product_id)[:1] or doc.x_fc_sale_order_id.order_line[:1]"/>
|
||||
</t>
|
||||
<table class="bordered">
|
||||
<thead>
|
||||
<tr><th colspan="2" class="fp-header-primary">PART & DESCRIPTIONS</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 30%; background-color: #f5f5f5; font-weight: bold;">Part Number</td>
|
||||
<td>
|
||||
<t t-if="_line and 'x_fc_part_catalog_id' in _line._fields and _line.x_fc_part_catalog_id">
|
||||
<strong>
|
||||
<span t-esc="_line.x_fc_part_catalog_id.part_number"/>
|
||||
<t t-if="_line.x_fc_part_catalog_id.revision">
|
||||
<span> (Rev <span t-esc="_line.x_fc_part_catalog_id.revision"/>)</span>
|
||||
</t>
|
||||
</strong>
|
||||
</t>
|
||||
<t t-else="">—</t>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: #f5f5f5; font-weight: bold;">Customer-Facing Description</td>
|
||||
<td>
|
||||
<t t-if="_line"><span t-esc="_line.name or '—'"/></t>
|
||||
<t t-else="">—</t>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: #f5f5f5; font-weight: bold;">Internal Description / Workflow</td>
|
||||
<td>
|
||||
<t t-if="_line and 'x_fc_internal_description' in _line._fields and _line.x_fc_internal_description">
|
||||
<span t-esc="_line.x_fc_internal_description" style="white-space: pre-wrap;"/>
|
||||
</t>
|
||||
<t t-else="">—</t>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color: #f5f5f5; font-weight: bold;">Service SKU</td>
|
||||
<td><span t-esc="doc.product_id.default_code or '—'"/></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- Sale / Portal links -->
|
||||
<table class="bordered">
|
||||
<thead>
|
||||
@@ -267,6 +320,51 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- Sub 2: Part number + dual descriptions (internal report).
|
||||
Operators still see the service SKU under PRODUCT above. -->
|
||||
<t t-set="_mo" t-value="doc.production_id"/>
|
||||
<t t-set="_so_lines" t-value="_mo.x_fc_sale_order_line_ids if 'x_fc_sale_order_line_ids' in _mo._fields else _mo.env['sale.order.line']"/>
|
||||
<t t-set="_line" t-value="_so_lines.filtered(lambda l: l.product_id == doc.product_id)[:1] or _so_lines[:1]"/>
|
||||
<t t-if="(not _line) and doc.x_fc_sale_order_id">
|
||||
<t t-set="_line" t-value="doc.x_fc_sale_order_id.order_line.filtered(lambda l: l.product_id == doc.product_id)[:1] or doc.x_fc_sale_order_id.order_line[:1]"/>
|
||||
</t>
|
||||
<table class="bordered info-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 22%;">PART NUMBER</th>
|
||||
<th style="width: 30%;">CUSTOMER-FACING DESCRIPTION</th>
|
||||
<th style="width: 34%;">INTERNAL DESCRIPTION / WORKFLOW</th>
|
||||
<th style="width: 14%;">SERVICE SKU</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<t t-if="_line and 'x_fc_part_catalog_id' in _line._fields and _line.x_fc_part_catalog_id">
|
||||
<strong>
|
||||
<span t-esc="_line.x_fc_part_catalog_id.part_number"/>
|
||||
<t t-if="_line.x_fc_part_catalog_id.revision">
|
||||
<span> (Rev <span t-esc="_line.x_fc_part_catalog_id.revision"/>)</span>
|
||||
</t>
|
||||
</strong>
|
||||
</t>
|
||||
<t t-else="">—</t>
|
||||
</td>
|
||||
<td>
|
||||
<t t-if="_line"><span t-esc="_line.name or '—'"/></t>
|
||||
<t t-else="">—</t>
|
||||
</td>
|
||||
<td>
|
||||
<t t-if="_line and 'x_fc_internal_description' in _line._fields and _line.x_fc_internal_description">
|
||||
<span t-esc="_line.x_fc_internal_description" style="white-space: pre-wrap;"/>
|
||||
</t>
|
||||
<t t-else="">—</t>
|
||||
</td>
|
||||
<td class="text-center"><span t-esc="doc.product_id.default_code or '—'"/></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- Process Parameters / Chemistry Targets side-by-side -->
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
|
||||
Reference in New Issue
Block a user