mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-14 18:51:21 +00:00
fix(crm): handle empty _assign in appointment auto assignment (#54782)
(cherry picked from commit a4a389bd41)
Co-authored-by: Sakthivel Murugan S <129778327+ssakthivelmurugan@users.noreply.github.com>
This commit is contained in:
@@ -234,10 +234,13 @@ def _get_agents_sorted_by_asc_workload(date):
|
|||||||
return agent_list
|
return agent_list
|
||||||
appointment_counter = Counter(agent_list)
|
appointment_counter = Counter(agent_list)
|
||||||
for appointment in appointments:
|
for appointment in appointments:
|
||||||
assigned_to = frappe.parse_json(appointment._assign)
|
assign_data = appointment._assign
|
||||||
if not assigned_to:
|
if isinstance(assign_data, str):
|
||||||
|
assign_data = assign_data.strip()
|
||||||
|
if not assign_data:
|
||||||
continue
|
continue
|
||||||
if (assigned_to[0] in agent_list) and getdate(appointment.scheduled_time) == date:
|
assigned_to = frappe.parse_json(assign_data)
|
||||||
|
if assigned_to and (assigned_to[0] in agent_list) and getdate(appointment.scheduled_time) == date:
|
||||||
appointment_counter[assigned_to[0]] += 1
|
appointment_counter[assigned_to[0]] += 1
|
||||||
sorted_agent_list = appointment_counter.most_common()
|
sorted_agent_list = appointment_counter.most_common()
|
||||||
sorted_agent_list.reverse()
|
sorted_agent_list.reverse()
|
||||||
|
|||||||
Reference in New Issue
Block a user