Selaa lähdekoodia

[minor] automatically add restrict to domain if not added

version-14
Rushabh Mehta 7 vuotta sitten
vanhempi
commit
ea42530112
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. +3
    -0
      frappe/core/doctype/doctype/doctype.py

+ 3
- 0
frappe/core/doctype/doctype/doctype.py Näytä tiedosto

@@ -753,6 +753,9 @@ def validate_permissions(doctype, for_remove=False):
def make_module_and_roles(doc, perm_fieldname="permissions"):
"""Make `Module Def` and `Role` records if already not made. Called while installing."""
try:
if doc.restrict_to_domain and not frappe.db.exists('Domain', doc.restrict_to_domain):
frappe.get_doc(doctype='Domain', domain=doc.restrict_to_domain).insert()

if not frappe.db.exists("Module Def", doc.module):
m = frappe.get_doc({"doctype": "Module Def", "module_name": doc.module})
m.app_name = frappe.local.module_app[frappe.scrub(doc.module)]


Ladataan…
Peruuta
Tallenna