fix: Correct field name from 'agent' to 'user' in CRM Telephony Agent creation

- The `CRM Telephony Agent` doctype requires the field `user` (not `agent`) as per its schema (`reqd: 1` + `autoname: field:user`).
- This fixes the `ValidationError: User is required` by using the correct field name when creating a new agent.
This commit is contained in:
Meer Uzair 2025-07-27 22:58:43 +05:30 committed by Shariq Ansari
parent 890299c2f3
commit 8de2a69a99

View File

@ -35,7 +35,7 @@ def set_default_calling_medium(medium):
frappe.get_doc(
{
"doctype": "CRM Telephony Agent",
"agent": frappe.session.user,
"user": frappe.session.user,
"default_medium": medium,
}
).insert(ignore_permissions=True)