From 750c7068e29732eb40910c9047921fb94c5d9836 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Wed, 20 May 2026 22:38:27 -0400 Subject: [PATCH] fix(fusion_repairs): activity-create access error + dashboard landing Two complaints from the first hands-on test: 1) Submit button raised "Access Error (Document type: Activity, Operation: create)" - the wizard called the intake service WITHOUT sudo so the mail.activity records the service schedules tripped on the activity ACL (admin's group chain does not auto-grant activity create on repair.order without sudo). Both portal controllers already sudo'd; the wizard now does too. x_fc_intake_user_id preserves audit identity regardless. Verified end-to-end as gsingh@westinhealthcare.com (admin): Created: BR-WA/RO/00025 Activities: 2 Source: backend_wizard Intake user: gsingh@westinhealthcare.com 2) "Real dashboard with dedicated pages would have been nice" - the main menu opened the wizard directly as a modal. Restructured so the menu lands on a proper kanban dashboard of service calls, matching the standard Odoo app pattern: Fusion Repairs (app icon) - Service Calls <- dashboard kanban (default landing) - New Service Call <- wizard (still a modal, accessed from menu OR kanban's New button) - All Repair Orders <- native Odoo repair list (full backend) - Maintenance Contracts - Configuration - Equipment Categories / Intake Templates / Service Catalogue / Repair Warranties New view_fusion_repair_dashboard_kanban shows urgency badges (red / amber / grey), category, scheduled date, intake source pill, and a 3rd-party warning. Default group_by=state. New view_fusion_repair_dashboard_search adds quick filters: Today, This Week, Safety/Urgent, Third-Party, Open, plus per-source filters and Group By (Status / Urgency / Category / Intake Source). Wizard remains target='new' (modal) so submitting drops the user back to the kanban they came from with the new repair visible. Bumped version to 19.0.1.0.2 to bust the asset bundle hash. Co-authored-by: Cursor --- fusion_repairs/__manifest__.py | 2 +- fusion_repairs/views/menus.xml | 21 +-- fusion_repairs/views/repair_order_views.xml | 122 +++++++++++++++++- fusion_repairs/wizard/repair_intake_wizard.py | 4 +- 4 files changed, 136 insertions(+), 13 deletions(-) diff --git a/fusion_repairs/__manifest__.py b/fusion_repairs/__manifest__.py index 3c6bc387..fd92d0d7 100644 --- a/fusion_repairs/__manifest__.py +++ b/fusion_repairs/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Fusion Repairs', - 'version': '19.0.1.0.1', + 'version': '19.0.1.0.2', 'category': 'Inventory/Repairs', 'summary': 'Guided medical equipment repair intake, dispatch, maintenance, and self-service portal', 'description': """ diff --git a/fusion_repairs/views/menus.xml b/fusion_repairs/views/menus.xml index b1176963..aed3c908 100644 --- a/fusion_repairs/views/menus.xml +++ b/fusion_repairs/views/menus.xml @@ -1,34 +1,35 @@ - + - - + sequence="15"/> - diff --git a/fusion_repairs/views/repair_order_views.xml b/fusion_repairs/views/repair_order_views.xml index 4f978e04..79a2eb75 100644 --- a/fusion_repairs/views/repair_order_views.xml +++ b/fusion_repairs/views/repair_order_views.xml @@ -147,7 +147,7 @@ - + New Service Call @@ -156,4 +156,124 @@ new + + + + + + + + repair.order.dashboard.fusion_repairs + repair.order + + + + + + + + + + + + + + +
+ + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + 3rd-party +
+
+
+
+
+
+ + + repair.order.search.fusion_repairs + repair.order + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Service Calls + repair.order + kanban,list,form + + {'search_default_open': 1} + +

No service calls yet

+

+ Click New in the top-left to open the guided + intake wizard. The form will walk you through caller info, + equipment selection, the issue, urgency and photos. +

+
+
+ + + + kanban + + + +
diff --git a/fusion_repairs/wizard/repair_intake_wizard.py b/fusion_repairs/wizard/repair_intake_wizard.py index f6769403..2447932d 100644 --- a/fusion_repairs/wizard/repair_intake_wizard.py +++ b/fusion_repairs/wizard/repair_intake_wizard.py @@ -69,7 +69,9 @@ class RepairIntakeWizard(models.TransientModel): 'equipment_items': [self._equipment_payload(eq) for eq in self.equipment_ids], } - repairs = self.env['fusion.repair.intake.service'].create_repair_orders( + # sudo() so sub-operations (mail.activity, mail.mail, fusion.technician.task) + # never trip on permission checks - x_fc_intake_user_id preserves audit identity. + repairs = self.env['fusion.repair.intake.service'].sudo().create_repair_orders( payload, source='backend_wizard', )