Browse Source

Merge pull request #1756 from MaxMorais/patch-20

Fix: AttributeError: 'dict' object has no attribute 'parenttype'
version-14
Rushabh Mehta 9 years ago
parent
commit
03742c1d36
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      frappe/client.py

+ 2
- 2
frappe/client.py View File

@@ -75,8 +75,8 @@ def insert(doc=None):

if doc.get("parent") and doc.get("parenttype"):
# inserting a child record
parent = frappe.get_doc(doc.parenttype, doc.parent)
parent.append(doc)
parent = frappe.get_doc(doc.get("parenttype"), doc.get("parent"))
parent.append(doc.get("parentfield"), doc)
parent.save()
return parent.as_dict()
else:


Loading…
Cancel
Save