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 <cursoragent@cursor.com>
This commit is contained in:
@@ -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',
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user