From 3a23409239762947803dd81aea40b56feb949cf9 Mon Sep 17 00:00:00 2001 From: Maxwell Morais Date: Sat, 14 May 2016 23:18:52 -0300 Subject: [PATCH] Fix: TypeError: unhashable type: 'dict' ```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 79, in insert parent.append(doc) File "/usr/frappe5/frappe-bench/apps/frappe/frappe/model/base_document.py", line 130, in append if not self.__dict__.get(key): TypeError: unhashable type: 'dict' ``` --- frappe/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/client.py b/frappe/client.py index f46b641dc9..54dce106bf 100644 --- a/frappe/client.py +++ b/frappe/client.py @@ -76,7 +76,7 @@ def insert(doc=None): if doc.get("parent") and doc.get("parenttype"): # inserting a child record parent = frappe.get_doc(doc.get("parenttype"), doc.get("parent")) - parent.append(doc) + parent.append(doc.get("parentfield"), doc) parent.save() return parent.as_dict() else: