Files
Odoo-Modules/fusion_plating/fusion_plating_reports/__manifest__.py
gsinghpal b93633d728 fix(shopfloor,reports): make QR scan actually navigate after decode
Two bugs were colluding to make iPhone scans look like "nothing
happens":

1. The in-app scanner was calling action.doAction({res_model: 'fp.job',
   res_id: <decoded-id>}). Old physical stickers (still on every box)
   encode /fp/wo/<mrp.production.id> — that id space doesn't match
   fp.job, so the form opened on a non-existent record and silently
   showed nothing. New /fp/job/<id> stickers happened to work because
   the IDs lined up by coincidence.

2. The /fp/wo/<id> controller redirected to mrp.production / mrp.workorder
   forms, both of which still exist as legacy records but aren't the
   canonical source of truth post-migration.

Fix:
- qr_scanner._handleCode now navigates via window.location.href instead
  of action.doAction. It hands /fp/job/<n> and /fp/wo/<n> URLs straight
  to the existing server-side controllers, which know how to resolve
  the right record. Bare numeric ids pasted manually -> /fp/job/<n>.
  Anything else surfaces the decoded text as an error so the operator
  can see decode worked but the value isn't a sticker.

- Modal now shows "Detected: <value>" the moment a code is decoded
  (before navigation), so even on slow phones the operator sees
  immediate feedback that the camera read the QR.

- wo_scan.py now resolves in this order:
    1. fp.job by legacy_mrp_production_id (migration-aware — old
       stickers route to the new model)
    2. mrp.production direct browse
    3. mrp.workorder direct browse
    4. fall back to /odoo/plating-jobs (or work-orders list)

Versions: shopfloor 19.0.17.0.0 -> 19.0.18.0.0,
          reports   19.0.7.15.0 -> 19.0.7.16.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 13:14:06 -04:00

61 lines
2.1 KiB
Python

# -*- coding: utf-8 -*-
# Copyright 2026 Nexa Systems Inc.
# License OPL-1 (Odoo Proprietary License v1.0)
{
'name': 'Fusion Plating — Reports',
'version': '19.0.7.16.0',
'category': 'Manufacturing/Plating',
'summary': 'PDF reports for Fusion Plating: quote, SO, WO, packing, BoL, CoC, invoice, receipt, quality + compliance.',
'depends': [
'sale',
'sale_pdf_quote_builder',
'account',
'stock',
'mrp',
'fusion_plating',
'fusion_plating_quality',
'fusion_plating_compliance',
'fusion_plating_safety',
'fusion_plating_portal',
'fusion_plating_configurator',
'fusion_plating_bridge_mrp',
'fusion_plating_logistics',
],
'data': [
'security/ir.model.access.csv',
'report/report_base_styles.xml',
'report/report_actions.xml',
# Quality + compliance reports
'report/report_coc.xml',
'report/report_ncr.xml',
'report/report_capa.xml',
'report/report_bath_chemistry_log.xml',
'report/report_calibration_cert.xml',
'report/report_fair.xml',
'report/report_audit.xml',
'report/report_incident.xml',
'report/report_spill.xml',
'report/report_waste_manifest.xml',
'report/report_discharge_sample.xml',
'report/report_wo_margin.xml',
# Quote-to-cash reports (portrait + landscape)
'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',
'report/report_fp_invoice.xml',
'report/report_fp_receipt.xml',
# Hide Odoo's default reports from the Print menu wherever FP
# ships an equivalent (loaded last so it overrides any earlier
# binding declarations from base modules).
'data/fp_hide_default_reports.xml',
],
'installable': True,
'application': False,
'auto_install': False,
'license': 'OPL-1',
}