diff --git a/fusion_plating/fusion_plating_configurator/wizard/fp_direct_order_wizard.py b/fusion_plating/fusion_plating_configurator/wizard/fp_direct_order_wizard.py index 716b2f8f..fec8eb90 100644 --- a/fusion_plating/fusion_plating_configurator/wizard/fp_direct_order_wizard.py +++ b/fusion_plating/fusion_plating_configurator/wizard/fp_direct_order_wizard.py @@ -752,24 +752,25 @@ class FpDirectOrderWizard(models.Model): part = line._get_or_bump_revision() resolved_parts[line.id] = part # Build the line header. Specification is optional; when - # missing, drop it from the header rather than printing - # "False - PartName Rev A". Same defensive treatment for - # part identifier and revision — `%s` on a False/NULL field - # used to print the literal string "False". - spec = getattr(line, 'customer_spec_id', False) - spec_label = (spec.display_name if spec else '') or _('No spec') - # Prefer part_number (set on every saved part); fall back to - # name; skip the segment entirely if both are missing. - part_label = part.part_number or part.name or '' - rev_suffix = (' Rev %s' % part.revision) if part.revision else '' - header = '%s - %s%s (x%d)' % ( - spec_label, - part_label or _('Unspecified part'), - rev_suffix, - line.quantity, - ) + # 2026-05-27 — drop the legacy "spec - PART Rev (xN)" header + # entirely from the customer-facing line name. Per user + # request, customer-facing reports (SO confirmation, invoice, + # CoC, packing slip, BoL) should show ONLY: + # - the customer-typed description (line.line_description) + # - the thickness range (rendered on its own line) + # The part number / revision / serial show in the dedicated + # Part Number column. The header was duplicating that info + # in the Description column. extended = (line.line_description or '').strip() - line_desc = (header + '\n\n' + extended) if extended else header + line_desc = extended or (part.part_number or '—') + + # G3 robustness (2026-05-27): make sure the line's process + # variant carries the order-level recipe if no per-line + # override exists. Belt-and-braces with the onchange/create + # propagation — catches the multi-part case where a new + # part's line never received the order recipe. + if not line.process_variant_id and self.material_process: + line.process_variant_id = self.material_process.id if line.description_template_id: line.description_template_id._register_usage() @@ -792,7 +793,13 @@ class FpDirectOrderWizard(models.Model): 'x_fc_start_at_node_id': line.start_at_node_id.id or False, 'x_fc_is_one_off': line.is_one_off, 'x_fc_quote_id': line.quote_id.id or False, - 'x_fc_process_variant_id': line.process_variant_id.id or False, + # Recipe propagation (G3) — line's process_variant_id, falling + # back to the order-level material_process recipe so multi-part + # orders still get the header recipe on every line. + 'x_fc_process_variant_id': ( + line.process_variant_id.id + or (self.material_process.id if self.material_process else False) + ), 'x_fc_save_as_default_process': line.save_as_default_process, # Sub 5 / Phase 1 — carry serial M2M to the SO line. # x_fc_serial_id is back-compat alias and auto-resolves diff --git a/fusion_plating/fusion_plating_reports/report/customer_line_header.xml b/fusion_plating/fusion_plating_reports/report/customer_line_header.xml index 16230564..13bafa5e 100644 --- a/fusion_plating/fusion_plating_reports/report/customer_line_header.xml +++ b/fusion_plating/fusion_plating_reports/report/customer_line_header.xml @@ -77,35 +77,37 @@ ========================================================== -->