I want to insert data in a doctype and it’s child table using frappeClient
links_dict = {
"doctype": "Dynamic Link",
"link_doctype": 'customer',
"link_name": dc['name'],#get customer name
}
doc = {
"doctype": "Address",
"address_title": dc['display_name'],
"address_type": add_type,
"email_id": dc['email'],
"phone": dc['phone'],
"city": cty,
"country": get_territory(dc['country_id']), #get country,
"address_line1": dc['street'],
"address_line2":dc['street2'],
"state":get_state(dc['state_id']),#get state,
"is_your_company_address":False,
"links": links_dic
}
if doc['address_title'] in add_check:
doc['address_title'] += str(dc['id'])
client.insert(doc)
Getting "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 class ‘str’
some people suggested using self.append() but it will not work here.