not working (v13)

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.

def add_customer():
    data = json.loads(
    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'] = data['city'] = data['country']
    customer.pincode = data['postal_code']


1 Like

I am having similar issue on version 13 the ignore_permissions=True flag doesn’t seem to work. Does anyone have a fix for this?

add below code in end check error log in erpnext for any issue

except Exception as e:
gen_response(500, cstr(e))

Thanks @mohitchechani , i found my problem, i had a chain of save document that i need to as ignore_permissions=True to as well as the frappe.db.get_list() also

The Contact and Address is auto-generated on creation of Customer. The Contact and Address requires permission that’s why it throws Not Permitted.

1 Like