feat(sticker): add Internal Sticker variant on sale.order Print menu
Same 3-cell + body layout as External; Notes column reads x_fc_internal_description (Sub 2 internal-description field on the SO line) instead of line.name. Shop floor gets ops-facing notes without leaking them to the customer-facing variant. New action record action_report_fp_so_sticker_internal — binds to sale.order, appears in the Print menu next to the existing External sticker. New template report_fp_so_sticker_internal that pre-sets _notes_content before t-calling the shared inner. Verified on SO-30019 with a seeded internal_description: Notes column reads "INTERNAL: rework if any dings on flange. Buff per WI-104." — confirms the override path is wired through the defaults-block initialiser, the inner's fallback chain, and the new outer template. 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)
|
||||
{
|
||||
'name': 'Fusion Plating — Reports',
|
||||
'version': '19.0.10.13.0',
|
||||
'version': '19.0.10.14.0',
|
||||
'category': 'Manufacturing/Plating',
|
||||
'summary': 'PDF reports for Fusion Plating: quote, SO, WO, packing, BoL, CoC, invoice, receipt, quality + compliance.',
|
||||
'depends': [
|
||||
|
||||
@@ -335,6 +335,20 @@
|
||||
<field name="paperformat_id" ref="paperformat_fp_wo_sticker"/>
|
||||
</record>
|
||||
|
||||
<!-- SO Internal sticker — same layout, prints internal description
|
||||
instead of the customer-facing line.name. Shop-floor variant. -->
|
||||
<record id="action_report_fp_so_sticker_internal" model="ir.actions.report">
|
||||
<field name="name">Internal Sticker</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">fusion_plating_reports.report_fp_so_sticker_internal</field>
|
||||
<field name="report_file">fusion_plating_reports.report_fp_so_sticker_internal</field>
|
||||
<field name="print_report_name">'Internal Sticker - %s' % (object.name or '').replace('/', '-')</field>
|
||||
<field name="binding_model_id" ref="sale.model_sale_order"/>
|
||||
<field name="binding_type">report</field>
|
||||
<field name="paperformat_id" ref="paperformat_fp_wo_sticker"/>
|
||||
</record>
|
||||
|
||||
<!-- ============================================================= -->
|
||||
<!-- 15. Packing Slip (Portrait + Landscape) -->
|
||||
<!-- ============================================================= -->
|
||||
|
||||
@@ -464,4 +464,37 @@
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<!-- ========== Outer template — sale.order Internal variant ==========
|
||||
Same layout + iteration as report_fp_so_sticker, but pre-sets
|
||||
_notes_content from x_fc_internal_description (Sub 2 internal
|
||||
description field) so the Notes column shows the ops-facing
|
||||
description instead of line.name. -->
|
||||
<template id="report_fp_so_sticker_internal">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="so">
|
||||
<t t-foreach="so.order_line.filtered(lambda l: l.x_fc_part_catalog_id)"
|
||||
t-as="line">
|
||||
<t t-call="fusion_plating_reports.report_fp_wo_sticker_defaults"/>
|
||||
<t t-set="_order_id" t-value="so.name"/>
|
||||
<t t-set="_scan_id" t-value="line.id"/>
|
||||
<t t-set="_scan_path" t-value="'/fp/so-line/'"/>
|
||||
<t t-set="_mo" t-value="False"/>
|
||||
<t t-set="_so" t-value="so"/>
|
||||
<t t-set="_line" t-value="line"/>
|
||||
<t t-set="_part" t-value="line.x_fc_part_catalog_id"/>
|
||||
<t t-set="_coating" t-value="line.x_fc_coating_config_id"/>
|
||||
<t t-set="_due" t-value="line.x_fc_part_deadline or so.commitment_date or False"/>
|
||||
<t t-set="_qty" t-value="line.product_uom_qty"/>
|
||||
<t t-set="_qty_total" t-value="line.product_uom_qty"/>
|
||||
<t t-set="_partner_name" t-value="so.partner_id.name"/>
|
||||
<t t-set="_mo_ref" t-value="''"/>
|
||||
<!-- Internal override: read x_fc_internal_description -->
|
||||
<t t-set="_notes_content" t-value="('x_fc_internal_description' in line._fields
|
||||
and line.x_fc_internal_description) or '-'"/>
|
||||
<t t-call="fusion_plating_reports.report_fp_wo_sticker_inner"/>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user