I am creating a public API for inserting new record. I actually did it on from version 12 but its not working now on version 13. I got Not Permitted
when inserting new record.
Here’s the code.
@frappe.whitelist(allow_guest=True)
def add_customer():
data = json.loads(frappe.request.data)
full_name = data['customer_fname'] + " " + data['customer_lname']
cust_name = full_name.title()
customer = frappe.new_doc('Customer')
customer.customer_name = cust_name
customer.mobile_no = data['mobile_no']
customer.email_id = data['email_id']
customer.address_line1 = data['address_line1']
customer.city = data['city']
customer.country = data['country']
customer.pincode = data['postal_code']
customer.save(ignore_permissions=True)
frappe.db.commit()
Thanks.