From 7f4f6ff6518bc6cf795d90ea9c74c48dfe0c8c88 Mon Sep 17 00:00:00 2001 From: Meer Uzair <121447358+MeerUzairWasHere@users.noreply.github.com> Date: Sun, 27 Jul 2025 22:58:43 +0530 Subject: [PATCH] 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. --- crm/integrations/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crm/integrations/api.py b/crm/integrations/api.py index 6c4e35e0..76151f1f 100644 --- a/crm/integrations/api.py +++ b/crm/integrations/api.py @@ -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)