Merge branch 'staging-fixes' into permission-fixes

This commit is contained in:
Suraj Shetty
2018-12-18 15:41:03 +05:30
committed by GitHub
118 changed files with 4077 additions and 4213 deletions

View File

@@ -3,12 +3,18 @@ from frappe import _
def execute():
""" assign lft and rgt appropriately """
if "Healthcare" not in frappe.get_active_domains():
return
frappe.reload_doc("healthcare", "doctype", "healthcare_service_unit")
frappe.reload_doc("healthcare", "doctype", "healthcare_service_unit_type")
company = frappe.get_value("Company", {"domain": "Healthcare"}, "name")
if not frappe.db.exists("Healthcare Service Unit", _('All Healthcare Service Units')):
if company:
frappe.get_doc({
'doctype': 'Healthcare Service Unit',
'healthcare_service_unit_name': _('All Healthcare Service Units'),
'is_group': 1
'is_group': 1,
'company': company
}).insert(ignore_permissions=True)

View File

@@ -32,7 +32,7 @@ def execute():
'user': user,
'default': 1
})
_doc.pos_profile_name = user + ' - ' + _doc.company
_doc.flags.ignore_validate = True
_doc.flags.ignore_mandatory = True
_doc.save()

View File

@@ -11,14 +11,14 @@ def execute():
for pos in frappe.get_all(doctype, filters={'disabled': 0}):
doc = frappe.get_doc(doctype, pos.name)
if not doc.user or doc.pos_profile_name: continue
if not doc.user: continue
try:
doc.pos_profile_name = doc.user + ' - ' + doc.company
pos_profile_name = doc.user + ' - ' + doc.company
doc.flags.ignore_validate = True
doc.flags.ignore_mandatory = True
doc.save()
frappe.rename_doc(doctype, doc.name, doc.pos_profile_name, force=True)
frappe.rename_doc(doctype, doc.name, pos_profile_name, force=True)
except frappe.LinkValidationError:
frappe.db.set_value("POS Profile", doc.name, 'disabled', 1)