Versions
- frappe-ui: 0.1.261
- frappe: 15.110.0
- crm: 1.73.0
Describe the bug
Calling document.save.submit() on a Single DocType (e.g. CRM Twilio Settings)
fails with:
TypeError: dict can not be used as parameter
Root Cause
In documentResource.js, the save resource uses frappe.client.set_value
and passes the entire doc object as fieldname:
return {
doctype: out.doctype,
name: out.name,
fieldname: values, // entire doc object — crashes for Single DocTypes
}
frappe.client.set_value cannot handle a dict as fieldname parameter.
Fix
Use frappe.client.save instead, which accepts the full doc correctly.
PR attached.
Versions
Describe the bug
Calling
document.save.submit()on a Single DocType (e.g. CRM Twilio Settings)fails with:
TypeError: dict can not be used as parameter
Root Cause
In
documentResource.js, thesaveresource usesfrappe.client.set_valueand passes the entire doc object as
fieldname:frappe.client.set_value cannot handle a dict as fieldname parameter.
Fix
Use
frappe.client.saveinstead, which accepts the full doc correctly.PR attached.