From ecac43eef42bff5552bcdc8291a9b067b8b1b88e Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Sat, 25 Apr 2026 13:03:29 -0400 Subject: [PATCH] fix(reports): restore the original ENTECH box-sticker layout for fp.job + sale.order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The original mrp.production / mrp.workorder sticker (logo + WO# stack on the left, big QR on the right, 7-row body with PO/Customer/Process/ Part Number/Due/Qty/Notes — the design ENTECH has been printing for months) lives in fusion_plating_reports.report_fp_wo_sticker_inner. The new fp.job sticker had been rebuilt from scratch with a different look. This wires fp.job into the existing canonical template instead. What changed: - report_fp_wo_sticker_inner — every t-set now uses the "_var or fallback-from-_mo" pattern so callers can pre-resolve values; mrp.production/mrp.workorder callers still work via the fallback path. - report_fp_wo_sticker_defaults — new shared template that initialises every overridable name to False so the inner's `or` chain doesn't NameError when an outer hasn't set it. - report_fp_job_sticker_template — replaces the parallel layout with a t-call to report_fp_wo_sticker_inner, feeding it from fp.job fields (name, partner_id, qty, date_deadline, sale_order_id, sale_order_line_ids, recipe_id, part_catalog_id, coating_config_id). - report_fp_so_sticker — new outer that iterates sale.order.order_line and emits one sticker per line that has a part_catalog_id. Bound to sale.order's print menu via action_report_fp_so_sticker. Versions: reports 19.0.7.14.0 -> 19.0.7.15.0, jobs 19.0.5.0.0 -> 19.0.5.1.0. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../fusion_plating_jobs/__manifest__.py | 2 +- .../report/report_fp_job_sticker.xml | 102 ++++---------- .../fusion_plating_reports/__manifest__.py | 2 +- .../report/report_actions.xml | 18 +++ .../report/report_fp_wo_sticker.xml | 132 +++++++++++++++--- 5 files changed, 159 insertions(+), 97 deletions(-) diff --git a/fusion_plating/fusion_plating_jobs/__manifest__.py b/fusion_plating/fusion_plating_jobs/__manifest__.py index 655aecf0..2076dd0e 100644 --- a/fusion_plating/fusion_plating_jobs/__manifest__.py +++ b/fusion_plating/fusion_plating_jobs/__manifest__.py @@ -3,7 +3,7 @@ # License OPL-1 (Odoo Proprietary License v1.0) { 'name': 'Fusion Plating — Native Jobs', - 'version': '19.0.5.0.0', + 'version': '19.0.5.1.0', 'category': 'Manufacturing/Plating', 'summary': 'Native plating job model — replaces mrp.production / mrp.workorder bridge.', 'author': 'Nexa Systems Inc.', diff --git a/fusion_plating/fusion_plating_jobs/report/report_fp_job_sticker.xml b/fusion_plating/fusion_plating_jobs/report/report_fp_job_sticker.xml index 8e4906b4..ef9df55a 100644 --- a/fusion_plating/fusion_plating_jobs/report/report_fp_job_sticker.xml +++ b/fusion_plating/fusion_plating_jobs/report/report_fp_job_sticker.xml @@ -3,12 +3,12 @@ Copyright 2026 Nexa Systems Inc. License OPL-1 (Odoo Proprietary License v1.0) - Native fp.job sticker — parallel to fusion_plating_reports' WO Box - Sticker which binds to mrp.production/mrp.workorder. Coexists during - the migration period. - - QR encodes /fp/job/ (controller added in Task TBD; for now scan - will fall back to /web/login if controller absent). + Native fp.job sticker — reuses the canonical box-sticker design from + fusion_plating_reports.report_fp_wo_sticker_inner. The visual layout + (logo + WO# stack on the left, big QR on the right, 7-row body table + underneath, all wrapped in a 2px border) is the one shop staff have + been printing since the mrp.production days; we just feed it from + fp.job fields here instead of mrp.production. --> @@ -43,73 +43,29 @@ diff --git a/fusion_plating/fusion_plating_reports/__manifest__.py b/fusion_plating/fusion_plating_reports/__manifest__.py index 4592ba94..c53bc336 100644 --- a/fusion_plating/fusion_plating_reports/__manifest__.py +++ b/fusion_plating/fusion_plating_reports/__manifest__.py @@ -3,7 +3,7 @@ # License OPL-1 (Odoo Proprietary License v1.0) { 'name': 'Fusion Plating — Reports', - 'version': '19.0.7.14.0', + 'version': '19.0.7.15.0', 'category': 'Manufacturing/Plating', 'summary': 'PDF reports for Fusion Plating: quote, SO, WO, packing, BoL, CoC, invoice, receipt, quality + compliance.', 'depends': [ diff --git a/fusion_plating/fusion_plating_reports/report/report_actions.xml b/fusion_plating/fusion_plating_reports/report/report_actions.xml index 16b03093..3ce7f987 100644 --- a/fusion_plating/fusion_plating_reports/report/report_actions.xml +++ b/fusion_plating/fusion_plating_reports/report/report_actions.xml @@ -369,6 +369,24 @@ + + + WO Box Sticker + sale.order + qweb-pdf + fusion_plating_reports.report_fp_so_sticker + fusion_plating_reports.report_fp_so_sticker + 'WO Sticker - %s' % (object.name or '').replace('/', '-') + + report + + + diff --git a/fusion_plating/fusion_plating_reports/report/report_fp_wo_sticker.xml b/fusion_plating/fusion_plating_reports/report/report_fp_wo_sticker.xml index a37707ff..3812a0f8 100644 --- a/fusion_plating/fusion_plating_reports/report/report_fp_wo_sticker.xml +++ b/fusion_plating/fusion_plating_reports/report/report_fp_wo_sticker.xml @@ -5,38 +5,70 @@ Parts-box identification sticker — printed on a 4x3" label. - Bound to BOTH mrp.production (MO) and mrp.workorder (WO) because - the shop talks in "WO #" terms (Steelhead legacy) but the data - hangs off the MO record. The inner template normalises either - input to the same set of resolved variables: + Bound to mrp.production (MO), mrp.workorder (WO), fp.job, and + sale.order. The shop talks in "WO #" terms (Steelhead legacy) but + the data may hang off any of those records. The inner template + normalises every input to the same set of resolved variables and + accepts either pre-resolved values from the outer template OR + resolves them itself from `_mo` when called from an mrp.* context. + Variables an outer template MAY pre-set (otherwise falls back to + `_mo`-based resolution): * _order_id — number to print as "WO #" - * _mo — the mrp.production record + * _scan_id — id encoded into the QR URL + * _scan_path — '/fp/job/' or '/fp/wo/' prefix (default '/fp/wo/') + * _mo — the mrp.production record (or False) * _so, _line — the originating sale order / line * _part — fp.part.catalog * _coating — fp.coating.config * _process — the resolved fusion.plating.process.node tree - * _scan_url — base_url + /fp/wo/ (encoded into the QR) + * _due — datetime/date for "Due Date" row + * _qty — float for "Qty" row + * _po_number — overrides _so.x_fc_po_number + * _partner_name — overrides _so.partner_id.name + * _mo_ref — string shown muted in "(WH/MO/...)" — '' to hide + * _internal_note— free text for "Notes" row --> + + +