I have created a custom doctype and a webform to let anyone create an entry. —> works
I have created a notification to get notified when a document get created - Send Alert on new)
Configured with Role ‘Website Manager’ as recipient (Doctype permission is set for the Website Manager)
—> The notification fails with
Traceback with variables (most recent call last):
File "apps/frappe/frappe/email/doctype/notification/notification.py", line 131, in send
self.send_an_email(doc, context)
self = <Notification: New Registered Device>
doc = <Document: REG-DEVICE-0097>
context = {'doc': <Document: REG-DEVICE-0097>, 'alert': <Notification: New Registered Device>, 'comments': None}
File "apps/frappe/frappe/email/doctype/notification/notification.py", line 207, in send_an_email
recipients, cc, bcc = self.get_list_of_recipients(doc, context)
self = <Notification: New Registered Device>
doc = <Document: REG-DEVICE-0097>
context = {'doc': <Document: REG-DEVICE-0097>, 'alert': <Notification: New Registered Device>, 'comments': None}
formataddr = <function formataddr at 0x7fa9671697e0>
make_communication = <function _make at 0x7fa953f2ba30>
subject = ' REG-DEVICE-0097 created by A User '
attachments = None
File "apps/frappe/frappe/email/doctype/notification/notification.py", line 300, in get_list_of_recipients
emails = get_info_based_on_role(recipient.receiver_by_role, "email")
self = <Notification: New Registered Device>
doc = <Document: REG-DEVICE-0097>
context = {'doc': <Document: REG-DEVICE-0097>, 'alert': <Notification: New Registered Device>, 'comments': None}
recipients = []
cc = ['name@mymail.com']
bcc = []
recipient = <NotificationRecipient: ecac7ac57c parent=New Registered Device>
File "apps/frappe/frappe/core/doctype/role/role.py", line 69, in get_info_based_on_role
users = frappe.get_list(
role = 'Website Manager'
field = 'email'
File "apps/frappe/frappe/__init__.py", line 1879, in get_list
return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
doctype = 'Has Role'
args = ()
kwargs = {'filters': {'role': 'Website Manager', 'parenttype': 'User'}, 'parent_doctype': 'User', 'fields': ['parent as user_name']}
frappe = <module 'frappe' from 'apps/frappe/frappe/init.py'>
File "apps/frappe/frappe/model/db_query.py", line 112, in execute
raise frappe.PermissionError(self.doctype)
self = <frappe.model.db_query.DatabaseQuery object at 0x7fa953c72530>
fields = ['parent as user_name']
filters = {'role': 'Website Manager', 'parenttype': 'User'}
or_filters = None
docstatus = None
group_by = None
order_by = 'KEEP_DEFAULT_ORDERING'
limit_start = False
limit_page_length = None
as_list = False
with_childnames = False
debug = False
ignore_permissions = False
user = None
with_comment_count = False
join = 'left join'
distinct = False
start = None
page_length = None
limit = None
ignore_ifnull = False
save_user_settings = False
save_user_settings_fields = False
update = None
add_total_row = None
user_settings = None
reference_doctype = None
run = True
strict = True
ignore_ddl = False
parent_doctype = 'User'
pluck = None
frappe.exceptions.PermissionError: Has Role
What’s wrong?