mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-17 18:45:20 +00:00
Merge branch 'staging-fixes' into permission-fixes
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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()
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user