Hello, is there a way to update a doctype using a dictionary?
if frappe.db.exists('Birthday', {'user': user}):
bday = frappe.get_doc('Birthday', new_data_dict)
bday.save()
Instead of doing this:
# data is my dict with updated fields
data = {}
if frappe.db.exists('Birthday', {'user': user}):
bday = frappe.get_doc('Birthday', {'user': user})
bday.date = data["date"]
bday.location = data["location"]
bday.surprise = data["surprise"]
bday.save()
else:
bday = frappe.get_doc('Birthday', data)
bday.insert()
Thanks