feat(reports+configurator): invoice PDF uses macro; x_fc_part_catalog_id on account.move.line (Sub 2 Task 19)

Invoice PDF (portrait + landscape) now collapses SKU + Description into
a single Part column rendered via fusion_plating_reports.customer_line_header,
so customer-facing invoices print the customer's part number (with
revision) instead of the internal service SKU.

To feed the macro on invoice lines, add x_fc_part_catalog_id to
account.move.line and override sale.order.line._prepare_invoice_line so
the part reference propagates automatically when an SO is invoiced.
This commit is contained in:
gsinghpal
2026-04-21 22:59:40 -04:00
parent 6cbea9d2f3
commit ea2cfc37c3
4 changed files with 41 additions and 19 deletions

View File

@@ -80,8 +80,7 @@
<table class="bordered">
<thead>
<tr>
<th style="width: 12%;">SKU</th>
<th class="text-start" style="width: 40%;">DESCRIPTION</th>
<th class="text-start" style="width: 52%;">PART</th>
<th style="width: 8%;">QTY</th>
<th style="width: 8%;">UOM</th>
<th style="width: 12%;">UNIT PRICE</th>
@@ -92,20 +91,15 @@
<tbody>
<t t-foreach="doc.invoice_line_ids" t-as="line">
<t t-if="line.display_type == 'line_section'">
<tr class="section-row"><td colspan="7"><strong t-field="line.name"/></td></tr>
<tr class="section-row"><td colspan="6"><strong t-field="line.name"/></td></tr>
</t>
<t t-elif="line.display_type == 'line_note'">
<tr class="note-row"><td colspan="7"><span t-field="line.name"/></td></tr>
<tr class="note-row"><td colspan="6"><span t-field="line.name"/></td></tr>
</t>
<t t-elif="not line.display_type or line.display_type == 'product'">
<tr>
<td class="text-center"><span t-esc="line.product_id.default_code or ''"/></td>
<td>
<t t-set="clean_name" t-value="line.name"/>
<t t-if="line.name and '] ' in line.name">
<t t-set="clean_name" t-value="line.name.split('] ', 1)[1]"/>
</t>
<span t-esc="clean_name"/>
<t t-call="fusion_plating_reports.customer_line_header"/>
</td>
<td class="text-center">
<span t-esc="int(line.quantity) if line.quantity == int(line.quantity) else line.quantity"/>
@@ -268,12 +262,11 @@
<!-- Lines — hide discount column unless at least one line has a discount -->
<t t-set="has_discount" t-value="any(l.discount for l in doc.invoice_line_ids)"/>
<t t-set="col_count" t-value="8 if has_discount else 7"/>
<t t-set="col_count" t-value="7 if has_discount else 6"/>
<table class="bordered">
<thead>
<tr>
<th style="width: 10%;">SKU</th>
<th class="text-start" style="width: 32%;">DESCRIPTION</th>
<th class="text-start" style="width: 42%;">PART</th>
<th style="width: 8%;">QTY</th>
<th style="width: 8%;">UOM</th>
<th style="width: 12%;">UNIT PRICE</th>
@@ -292,13 +285,8 @@
</t>
<t t-elif="not line.display_type or line.display_type == 'product'">
<tr>
<td class="text-center"><span t-esc="line.product_id.default_code or ''"/></td>
<td>
<t t-set="clean_name" t-value="line.name"/>
<t t-if="line.name and '] ' in line.name">
<t t-set="clean_name" t-value="line.name.split('] ', 1)[1]"/>
</t>
<span t-esc="clean_name"/>
<t t-call="fusion_plating_reports.customer_line_header"/>
</td>
<td class="text-center">
<span t-esc="int(line.quantity) if line.quantity == int(line.quantity) else line.quantity"/>