Frappe - Allow Create New Records but Prevent Updates

I have a new custom doctype. I have a role that needs authorization only to CREATE but not UPDATE the records that exist. I know how the SUBMIT works, but in this case, I do not want to use issubmittable.

Thanks
Raj

please go check on Role Permissions Manager and try unchecking Write, but leave Create checked.

Tried that. Did not fix it. If you take WRITE away, it will not allow to write at all.

I see, so I guess you should hook a .py file to your event that catches if user is not authorized then it would not continue. That’s just my suggestion

Hi @Rajkumar_Thasma

You can disable save button in Frappe. Refer below code

frappe.ui.form.on("Leave Control Panel", "refresh", function(frm) {
	frm.disable_save();
}); 

Just add your conditions before calling disable_save method by checking particular user roles & cur_frm.doc.__islocal property .

Also, you can try by setting If user is the owner property in doctype permissions. So user will not able to see documents created by other users but it will still allow to update records which are created by him/her.

1 Like

how you are creating new records for existing doctype?