Getting While trying to Save Sales Order

Hi,
While trying to save Sales Order, I am getting the below error, any idea what could be the cause?

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 12, in savedocs
doc = frappe.get_doc(json.loads(doc))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 606, in get_doc
return frappe.model.document.get_doc(arg1, arg2)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 51, in get_doc
return controller(arg1, arg2)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py”, line 25, in init
super(SalesOrder, self).init(arg1, arg2)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py”, line 20, in init
super(AccountsController, self).init(arg1, arg2)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 87, in init
super(Document, self).init(arg1)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 52, in init
self.update(d)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 75, in update
self.set(key, value)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 122, in set
self.extend(key, value)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 148, in extend
self.append(key, v)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 136, in append
value = self._init_child(value, key)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 163, in _init_child
value = get_controller(value[“doctype”])(value)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 87, in init
super(Document, self).init(arg1)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 52, in init
self.update(d)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 75, in update
self.set(key, value)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 122, in set
self.extend(key, value)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 148, in extend
self.append(key, v)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 143, in append
raise ValueError, "Document attached to child table must be a dict or BaseDocument, not " + str(type(value))[1:-1]
ValueError: Document attached to child table must be a dict or BaseDocument, not type ‘list’

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 56, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 42, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 907, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 12, in savedocs
doc = frappe.get_doc(json.loads(doc))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 606, in get_doc
return frappe.model.document.get_doc(arg1, arg2)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 51, in get_doc
return controller(arg1, arg2)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py”, line 25, in init
super(SalesOrder, self).init(arg1, arg2)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py”, line 20, in init
super(AccountsController, self).init(arg1, arg2)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 87, in init
super(Document, self).init(arg1)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 52, in init
self.update(d)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 75, in update
self.set(key, value)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 122, in set
self.extend(key, value)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 148, in extend
self.append(key, v)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 136, in append
value = self._init_child(value, key)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 163, in _init_child
value = get_controller(value[“doctype”])(value)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 87, in init
super(Document, self).init(arg1)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 52, in init
self.update(d)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 75, in update
self.set(key, value)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 122, in set
self.extend(key, value)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 148, in extend
self.append(key, v)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 143, in append
raise ValueError, "Document attached to child table must be a dict or BaseDocument, not " + str(type(value))[1:-1]
ValueError: Document attached to child table must be a dict or BaseDocument, not type ‘list’

Regards
Ruchin Sharma

Hi,
I have found the problem but still not understand why this problem came.

Actually, I have a custom child table and in the child table there is a field called variation which is a link of a doctype, called Item Alterate Option

Shipping List Child Table in Sales Order:

Whenever, I select anything in variation field and try to save the table, it gives me the error.

Edit: Whenever, I select anything in variation field and try to save the Sales Order Form, it gives me the error.

Regards
Ruchin Sharma

Hi,

Please share error message received in the browser’s console, so that we can support you better.