diff --git a/fusion_plating/fusion_plating_reports/__init__.py b/fusion_plating/fusion_plating_reports/__init__.py index 140643d0..1a132267 100644 --- a/fusion_plating/fusion_plating_reports/__init__.py +++ b/fusion_plating/fusion_plating_reports/__init__.py @@ -3,3 +3,4 @@ # License OPL-1 (Odoo Proprietary License v1.0) from . import models +from . import controllers diff --git a/fusion_plating/fusion_plating_reports/__manifest__.py b/fusion_plating/fusion_plating_reports/__manifest__.py index 128f548c..6f4538f9 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.6.0.0', + 'version': '19.0.7.0.0', 'category': 'Manufacturing/Plating', 'summary': 'PDF reports for Fusion Plating: quote, SO, WO, packing, BoL, CoC, invoice, receipt, quality + compliance.', 'depends': [ @@ -42,6 +42,7 @@ 'report/customer_line_header.xml', 'report/report_fp_sale.xml', 'report/report_fp_work_order.xml', + 'report/report_fp_wo_sticker.xml', 'report/report_fp_job_traveller.xml', 'report/report_fp_packing_slip.xml', 'report/report_fp_bol.xml', diff --git a/fusion_plating/fusion_plating_reports/controllers/__init__.py b/fusion_plating/fusion_plating_reports/controllers/__init__.py new file mode 100644 index 00000000..564c861a --- /dev/null +++ b/fusion_plating/fusion_plating_reports/controllers/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2026 Nexa Systems Inc. +# License OPL-1 (Odoo Proprietary License v1.0) + +from . import wo_scan diff --git a/fusion_plating/fusion_plating_reports/controllers/wo_scan.py b/fusion_plating/fusion_plating_reports/controllers/wo_scan.py new file mode 100644 index 00000000..b38e8401 --- /dev/null +++ b/fusion_plating/fusion_plating_reports/controllers/wo_scan.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Copyright 2026 Nexa Systems Inc. +# License OPL-1 (Odoo Proprietary License v1.0) +# Part of the Fusion Plating product family. +# +# /fp/wo/ — scan-redirect endpoint. +# +# The WO box sticker embeds a QR code that encodes this URL. When +# warehouse staff scan the sticker with their phone / tablet / +# handheld scanner, the device opens the URL; this controller then +# redirects them to the work-order form inside Odoo's backend. +# Logged-out users land on the standard Odoo login page and bounce +# back after authenticating (Odoo's redirect handles the round-trip). + +from odoo import http +from odoo.http import request + + +class FpWoScanController(http.Controller): + + @http.route('/fp/wo/', type='http', auth='user', website=False) + def wo_scan_redirect(self, wo_id, **kwargs): + """Redirect a scanned WO sticker to the work-order form. + + Uses Odoo 17+/19's action-URL format so the backend opens + directly on the WO's form view. Falls back to a generic + not-found URL if the id doesn't resolve. + """ + wo = request.env['mrp.workorder'].sudo().browse(wo_id).exists() + if not wo: + # Land on the list of all WOs so staff can search manually. + return request.redirect('/odoo/manufacturing/work-orders') + # /odoo/action-/ opens the record's form view. + # Using the vanilla MRP action here so it works regardless of + # whether the user has Plating-specific menus. + return request.redirect( + '/odoo/action-mrp.action_mrp_workorder/%d' % wo.id + ) diff --git a/fusion_plating/fusion_plating_reports/report/report_actions.xml b/fusion_plating/fusion_plating_reports/report/report_actions.xml index 0e8d715e..e34ef2bc 100644 --- a/fusion_plating/fusion_plating_reports/report/report_actions.xml +++ b/fusion_plating/fusion_plating_reports/report/report_actions.xml @@ -315,6 +315,39 @@ + + + + + + + FP WO Sticker (4x3") + custom + 102 + 76 + Landscape + 3 + 3 + 3 + 3 + + 0 + + 300 + + + + WO Box Sticker + mrp.workorder + qweb-pdf + fusion_plating_reports.report_fp_wo_sticker + fusion_plating_reports.report_fp_wo_sticker + 'WO Sticker - %s' % object.name + + 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 new file mode 100644 index 00000000..c5104760 --- /dev/null +++ b/fusion_plating/fusion_plating_reports/report/report_fp_wo_sticker.xml @@ -0,0 +1,150 @@ + + + + + + +