[Version 11] DocType Employee Loan not found

When I open permission manager - desk#permission-manager
I get the error DocType Employee Loan not found

any help why?

Employee Loan has been renamed to a more generic Loan and is now extended to other party types like Members

Ok. But how to fix that error?

Just rerun ‘bench update --patch’ - that should apply the patches that update the table structures, along with any user data stored in them.

The patch in question in your case is this one

For the code to say healthy, renaming tables, renaming methods and moving code around is essential.

Such code refactoring is needed to manage and reduce technical debt. Unmaintained code risks becoming too risky laborious or costly to change and that could spell doom.

That is a key reason why ERPNext adheres to a monolithic code base.

1 Like

I still have this problem. I rerun bench update --patch but this didn’t help. I can’t use Role Permission Manager. As soon as I select Employee from the dropdown menu I get the above error.

I checked also via Setup->Doc Type, and there is no Employee Loan, only Loan DocType.
I’m confused, why am I getting this error message? Can you please help?

right now on:
frappe@ubuntu:~/frappe-bench$ bench version
erpnext 11.1.5
frappe 11.1.5

To post an error traceback or screenshot that might sort out the confusion here!

erp_perm

no other error…or at least I don’t know where to look for traceback.

EDIT: 99+ errors in error log is because this is running on localhost so emails are not sent. I want to wait with upgrade on production server after I resolve the issues.

1 Like

ok right that message is not an error - Employee Loan can’t be found since that doctype is no longer present in v11. Can you lookup Loan instead - that should be successful?

Also you seem to be selecting a Role and not a DocType?

I’m confused. How is this not an error? How can I select role “Employee” and see all relevant DocType to modify permissions if I’m getting this message?
I have never used Employee Loan before. I understand Employee Loan is no longer in v11. But I’m getting this error and I would like to ask you experienced developers how to fix this.
In v10 Role Permission Manager works well, but now in v11 it doesn’t…at least not for me;(

EDIT: I know I can select individual Doc Type and put permissions there, but it is a nice feature to select Role and get all DocTypes for this role. And this now doesn’t work for me.

If you click on your login id, you will get a menu - click Reload to flush the cache.

I did that, I got side pop-up message ‘cache cleared’ but the problem is still there. I tried open/close browser, even different browser, no change.

ok agreed please report this here Issues · frappe/erpnext · GitHub

Be sure to link there to this here and vice versa thanks bedo

EDIT: What else you could try - recompile the server code ‘find . “*.pyc” -delete’ and the gui client code ‘bench build’

so I did the below, but no change.

frappe@ubuntu:~/frappe-bench$ find . -name *.pyc -delete
frappe@ubuntu:~/frappe-bench$ bench build
yarn run v1.5.1
$ FRAPPE_ENV=production node rollup/build.js
Production mode
✔ Built js/moment-bundle.min.js
✔ Built js/libs.min.js

Building frappe assets...

✔ Built js/print_format_v3.min.js
✔ Built js/dialog.min.js
✔ Built js/web_form.min.js
✔ Built js/form.min.js
✔ Built js/list.min.js
✔ Built js/chat.js
✔ Built js/desk.min.js
✔ Built css/frappe-rtl.css
✔ Built css/module.min.css
✔ Built css/form.min.css
✔ Built css/list.min.css
✔ Built css/report.min.css
✔ Built frappe/css/email.css
✔ Built css/web_form.css
✔ Built css/frappe-web.css
✔ Built css/desk.min.css
✔ Built js/control.min.js
✔ Built js/frappe-web.min.js
✔ Built js/report.min.js
✨  Done in 50.228s

Building erpnext assets...

✔ Built js/item-dashboard.min.js
✔ Built js/erpnext-web.min.js
✔ Built js/erpnext.min.js
✔ Built css/erpnext-web.css
✔ Built css/marketplace.css
✔ Built css/erpnext.css
✔ Built js/marketplace.min.js
✨  Done in 17.701s
Done in 75.57s.
frappe@ubuntu:~/frappe-bench$
frappe@ubuntu:~/frappe-bench$ bench restart
INFO:bench.utils:sudo supervisorctl restart frappe-bench-workers: frappe-bench-web:
frappe-bench-workers:frappe-bench-frappe-schedule: stopped
frappe-bench-workers:frappe-bench-frappe-default-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-long-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-short-worker-0: stopped
frappe-bench-web:frappe-bench-node-socketio: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: started
frappe-bench-workers:frappe-bench-frappe-default-worker-0: started
frappe-bench-workers:frappe-bench-frappe-long-worker-0: started
frappe-bench-workers:frappe-bench-frappe-short-worker-0: started
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: started
frappe@ubuntu:~/frappe-bench$

Can someone help with this please? I checked the sql table tabDocPerm and there is no Employee Loan Parent for Employee Role.

But I’m no developer, I don’t really know what code/sql is triggered when the selection is made from dropdown menu at http://localhost:8080/desk#permission-manager
I can check my database for the Employee Loan text, but I’m not sure where to look.

I can also test and debug, but I would need exact commands that I should run :slight_smile:

So, this issue is still here, without fix. There is a workaround on github issue I opened.

Hi, i got same issue for different doctypes. It seems like custom perm was not changed during update. So old DocTypes names are still there. I created python function for that. Maybe it help you:

def change_custom_perms():

old_doctype = "Supplier Type"
new_doctype = "Supplier Group"

all = frappe.get_all("Custom DocPerm", filters={"parent": old_doctype}, fields=["*"])
for a in all:
    frappe.db.set_value("Custom DocPerm", a.name, 'parent', new_doctype)

For those of you with no idea about python and custom apps (like me) about what is written above, another solution is to go directly into database, find table tabCustom DocPerm, here check “parent” column.
In my case I had to change values “Employee Loan” to “Loan” for all records.

please, if someone know how to push a fix into the master, let’s help the community;)

3 Likes