Create Customer , After Create new User

hey guys i have a little problem ,

i want create a new customer automatically after create user on erpnext, im already create hook and file python to create new customer, but when i try to create new user, i got some error like image below , whats wrong with my code ? anyone have some suggest for me to clear this case ?

thanks,
hook.py
1

user_addon.py
2

error log

1 Like

Change hooks to after_insert, and just customer = frappe.new_doc(‚ÄėCustomer Management‚Äô)