feat: add Pending status for delivery/technician tasks

- New 'pending' status allows tasks to be created without a schedule,
  acting as a queue for unscheduled work that gets assigned later
- Pending group appears in the Delivery Map sidebar with amber color
- Other modules can create tasks in pending state for scheduling
- scheduled_date no longer required (null for pending tasks)
- New Pending Tasks menu item under Field Service
- Pending filter added to search view

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
gsinghpal
2026-02-24 04:21:05 -05:00
parent 84c009416e
commit 0e1aebe60b
26 changed files with 2735 additions and 9 deletions

View File

@@ -169,7 +169,6 @@ class FusionTechnicianTask(models.Model):
# ------------------------------------------------------------------
scheduled_date = fields.Date(
string='Scheduled Date',
required=True,
tracking=True,
default=fields.Date.context_today,
index=True,
@@ -265,6 +264,7 @@ class FusionTechnicianTask(models.Model):
# STATUS
# ------------------------------------------------------------------
status = fields.Selection([
('pending', 'Pending'),
('scheduled', 'Scheduled'),
('en_route', 'En Route'),
('in_progress', 'In Progress'),
@@ -851,6 +851,7 @@ class FusionTechnicianTask(models.Model):
@api.depends('status')
def _compute_color(self):
color_map = {
'pending': 5, # purple
'scheduled': 0, # grey
'en_route': 4, # blue
'in_progress': 2, # orange
@@ -2126,7 +2127,7 @@ class FusionTechnicianTask(models.Model):
'time_start', 'time_start_display', 'time_end_display',
'status', 'scheduled_date', 'travel_time_minutes',
'x_fc_sync_client_name', 'x_fc_is_shadow', 'x_fc_sync_source'],
order='scheduled_date asc, time_start asc',
order='scheduled_date asc NULLS LAST, time_start asc',
limit=500,
)
locations = self.env['fusion.technician.location'].get_latest_locations()