Merge pull request #2118 from neilLasrado/develop
Fix - add role to roles table if mentioned in hooks portal menu items
This commit is contained in:
commit
affa40db83
1 changed files with 2 additions and 0 deletions
|
|
@ -28,6 +28,8 @@ class PortalSettings(Document):
|
|||
'''Sync portal menu items'''
|
||||
dirty = False
|
||||
for item in frappe.get_hooks('portal_menu_items'):
|
||||
if item.get('role') and not frappe.db.exists("Role", item.get('role')):
|
||||
frappe.get_doc({"doctype": "Role", "role_name": item.get('role'), "desk_access": 0}).insert()
|
||||
if self.add_item(item):
|
||||
dirty = True
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue