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:
Nabin Hait 2016-09-29 11:37:52 +05:30 committed by GitHub
commit affa40db83

View file

@ -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