Sfoglia il codice sorgente

Fix - add role to roles table if mentioned in hooks portal menu items

version-14
Neil Trini Lasrado 8 anni fa
parent
commit
79a101df78
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. +2
    -0
      frappe/website/doctype/portal_settings/portal_settings.py

+ 2
- 0
frappe/website/doctype/portal_settings/portal_settings.py Vedi 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



Caricamento…
Annulla
Salva