Sales Order Item doctype inserting

I’m trying to insert all mandatory fields that are required in the Sales Order Item doctype which are (item_code, item_name, description and qty) and image field but it still raise me that error:

Traceback (most recent call last):
File “/home/ahmed/frappe-bench/apps/frappe/frappe/app.py”, line 60, in application
response = frappe.api.handle()
File “/home/ahmed/frappe-bench/apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “/home/ahmed/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/ahmed/frappe-bench/apps/frappe/frappe/handler.py”, line 36, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/ahmed/frappe-bench/apps/frappe/frappe/init.py”, line 887, in call
return fn(*args, **newargs)
File “/home/ahmed/frappe-bench/apps/myproducts/myproducts/www/shopcart.py”, line 40, in addToShopcart
“image”: item[0].thumbnail
File “/home/ahmed/frappe-bench/apps/frappe/frappe/model/document.py”, line 190, in insert
self._validate()
File “/home/ahmed/frappe-bench/apps/frappe/frappe/model/document.py”, line 384, in _validate
self._validate_mandatory()
File “/home/ahmed/frappe-bench/apps/frappe/frappe/model/document.py”, line 604, in _validate_mandatory
name=self.name))
MandatoryError: [Sales Order Item, 5ac31ef15d]: parent, parenttype

Please advice @mostafa @rmehta

1 Like

@random.1 please don’t @-tag users. This is a voluntary forum and no one is obligated to reply