Doctype document not existed

Hi experts
I removed doctype from system manager role the I decided to back it but I did not find it.
And the Restore Original Permission button not work.
please advise.

Permissions are set on Roles and Document Types (called DocTypes) by setting rights like Read, Write, Create, Delete, Submit, Cancel etc.
Request you to elaborate that hich Doctype was deleted for the which role.

Hi Arund
I mean the following and why Restore Original Permission button not work to restore the Original Permission role in this case.

Note: I Tested even on demo hosted ERPNext but the same issue


In develop branch, standard roles are always synced with the original. And custom perms are managed separately. Hence, the issue should be fixed in the version 8.

Now, for your instance, you need to add the permission from the console, using code.

Thanks nabinhait
I am not a developer and please explain for me… did you mean that I can not restore the permission for doctype (system manger) which I deleted, just by using code?
And is this just with doctype (this case) or with all other documents?
Many thanks,


Can you please share the use case which required you deleting a Doctype or Role Permission for it? Was it a standard Doctype or a Custom One?

If you have only deleted the permission role for a Doctype, you can add it again using a Add new Rule feature in the Role Permission Manager.

Dear Umair
First thanks for your reply . let’s explain step by step
1- when I opened the standard role system manager and under the column Document Type there are document type called doctype as per image below:

2- I deleted this raw from grid to try to prevent System Manager from working on Doctype in setup page as per below image

3- Then I decided to restore the deleted document type called doctype but I could not find it in list to back it and when press Restore Original Permission button this document type called doctype not appear again.

I hope the issue clear now I am trying to contribute to improve ERPNext


bench --force --site site_name migrate

Thanks saurabh but issue is still existed

Restoration from the UI is not possible only for doctype “DocType”. Actually, it should not come in Permission Manager as well, I have fixed that in the develop branch.

Now, you have to fix this from console, you can open the console using command bench --site <your-site-name> console from frappe-bench directory. In console, try following code.

import frappe
frappe.reload_doctype("DocType", force=True, reset_permissions=True)
1 Like

Thanks for your efforts

1 Like

If you have used ERPNext, and liked it, then please help us spread the word by submitting your reviews on the following sites.

We as a community can achieve lot more than individuals.

1 Like