Skip to content

fix: save() fails with TypeError: dict can not be used as parameter for Single DocTypes #767

Description

@prateekjoshi44

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingjavascriptPull requests that update javascript codetriagedSeen by barista

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions