From d1c6c9f0f1bcd8d2125adbcfcf8c228a024c92b4 Mon Sep 17 00:00:00 2001 From: Maxwell Morais Date: Sat, 14 May 2016 23:14:54 -0300 Subject: [PATCH] Fix: AttributeError: 'dict' object has no attribute 'parenttype' ```python Traceback (innermost last): File "/usr/frappe5/frappe-bench/apps/frappe/frappe/app.py", line 57, in application response = frappe.handler.handle() File "/usr/frappe5/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle execute_cmd(cmd) File "/usr/frappe5/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd ret = frappe.call(method, **frappe.form_dict) File "/usr/frappe5/frappe-bench/apps/frappe/frappe/__init__.py", line 805, in call return fn(*args, **newargs) File "/usr/frappe5/frappe-bench/apps/frappe/frappe/client.py", line 78, in insert parent = frappe.get_doc(doc.parenttype, doc.parent) AttributeError: 'dict' object has no attribute 'parenttype' ``` --- frappe/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/client.py b/frappe/client.py index 0920e7d5df..f46b641dc9 100644 --- a/frappe/client.py +++ b/frappe/client.py @@ -75,7 +75,7 @@ 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 = frappe.get_doc(doc.get("parenttype"), doc.get("parent")) parent.append(doc) parent.save() return parent.as_dict()