No permission to read Lead

Hi,

I’m using v5. Let’s say we don’t want to use doctype:Lead so I removed read permission to both sales user/manager and all users but it gave this error when the user login. Please help. Tks

Traceback (innermost last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/render.py”, line 23, in render
data = render_page(path)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/render.py”, line 116, in render_page
return build(path)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/render.py”, line 125, in build
return build_method(path)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/render.py”, line 141, in build_page
context = get_context(path)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/context.py”, line 28, in get_context
context = build_context(context)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/website/context.py”, line 73, in build_context
ret = module.get_context(context)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/templates/pages/desk.py”, line 22, in get_context
boot = frappe.sessions.get()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/sessions.py”, line 95, in get
bootinfo[“notification_info”] = get_notification_info_for_boot()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/notifications.py”, line 108, in get_notification_info_for_boot
out = get_notifications()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/notifications.py”, line 21, in get_notifications
“open_count_doctype”: get_notifications_for_doctypes(config, notification_count),
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/notifications.py”, line 72, in get_notifications_for_doctypes
filters=condition, as_list=True)[0][0]
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 862, in get_list
return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 50, in execute
return self.build_and_run()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 53, in build_and_run
args = self.prepare_args()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 68, in prepare_args
self.build_conditions()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 196, in build_conditions
match_conditions = self.build_match_conditions()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 286, in build_match_conditions
frappe.throw(_(“No permission to read {0}”).format(self.doctype))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 250, in throw
msgprint(msg, raise_exception=exc)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 243, in msgprint
_raise_exception()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 228, in _raise_exception
raise raise_exception, encode(msg)
ValidationError: No permission to read Lead

I know…if you don’t want to use a doctype, just remove it from role permission manager instead of just uncheck its read permission…