diff --git a/fusion_plating/fusion_plating_reports/__manifest__.py b/fusion_plating/fusion_plating_reports/__manifest__.py index a93caaa3..5cd85d9b 100644 --- a/fusion_plating/fusion_plating_reports/__manifest__.py +++ b/fusion_plating/fusion_plating_reports/__manifest__.py @@ -3,11 +3,12 @@ # License OPL-1 (Odoo Proprietary License v1.0) { 'name': 'Fusion Plating — Reports', - 'version': '19.0.4.7.0', + 'version': '19.0.4.8.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', @@ -45,6 +46,10 @@ '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, diff --git a/fusion_plating/fusion_plating_reports/data/fp_hide_default_reports.xml b/fusion_plating/fusion_plating_reports/data/fp_hide_default_reports.xml new file mode 100644 index 00000000..80425cb6 --- /dev/null +++ b/fusion_plating/fusion_plating_reports/data/fp_hide_default_reports.xml @@ -0,0 +1,85 @@ + + + + + + + + action + + + + action + + + + + + action + + + + action + + + + + + action + + + + + + action + + + + + + action + + + diff --git a/fusion_plating/scripts/fp_audit_reports.py b/fusion_plating/scripts/fp_audit_reports.py new file mode 100644 index 00000000..e91fa558 --- /dev/null +++ b/fusion_plating/scripts/fp_audit_reports.py @@ -0,0 +1,24 @@ +env = env # noqa +# List all ir.actions.report bindings on the models we care about +MODELS = ['sale.order', 'account.move', 'stock.picking', 'mrp.production', + 'fusion.plating.delivery', 'account.payment', 'fusion.plating.portal.job', + 'fp.certificate'] +print(f'{"model":<32} {"xmlid":<55} {"name":<40}') +print('-' * 130) +for m in MODELS: + model = env['ir.model'].search([('model', '=', m)], limit=1) + if not model: + continue + reports = env['ir.actions.report'].search([ + ('binding_model_id', '=', model.id), + ('binding_type', '=', 'report'), + ]) + for r in reports: + # Get the xmlid + xmlids = env['ir.model.data'].search([ + ('model', '=', 'ir.actions.report'), ('res_id', '=', r.id) + ]) + xmlid = ', '.join(f'{x.module}.{x.name}' for x in xmlids) or '(no xmlid)' + is_fp = 'fusion_plating' in xmlid + marker = '✓ FP' if is_fp else ' ' + print(f' {marker} {m:<28} {xmlid:<55} {r.name[:40]}')