I have been using ERPNext for about a year and updating regularly. I ran bench reset-perms because I suspect I had a permission problem before. I have been unable to access Accounts->Tools->Bank Reconciliation.
I have notice the code in reset-perms its just deleting all records in tabDocPerm that is istable=0 and custom=0.
Would that be the reason that even Administrator has no access because DocPerm is empty?
"""Reset permissions for given doctype."""
from frappe.desk.notifications import delete_notification_count_for
frappe.db.sql("""delete from tabDocPerm where parent=%s""", doctype)
frappe.reload_doc(frappe.db.get_value("DocType", doctype, "module"),
"DocType", doctype, force=True)
Backup the Database using "bench backup --with files"If you have entered “bench reset-perms” before, the table Dumping Data for “tabDocPerm” in the Database is emty. Go to a previous backup and copy the part under tabDocPerm / Dumping
Data and paste that into the newly created sql Backup using somethign
– Dumping data for table tabDocPerm
LOCK TABLES tabDocPerm WRITE;
/*!40000 ALTER TABLE tabDocPerm DISABLE KEYS /
“PASTE HERE BEGINNIG WITH INSERT INTO”
/!40000 ALTER TABLE tabDocPerm ENABLE KEYS */;
Now you can import the Database using "bench --force restore /path2SQLBackup
Now you have the latest data with only permissions restored from another backup.