diff --git a/erpnext/patches/v11_0/create_department_records_for_each_company.py b/erpnext/patches/v11_0/create_department_records_for_each_company.py index da97476fd3..c03cf989a2 100644 --- a/erpnext/patches/v11_0/create_department_records_for_each_company.py +++ b/erpnext/patches/v11_0/create_department_records_for_each_company.py @@ -3,6 +3,8 @@ from frappe import _ from frappe.utils.nestedset import rebuild_tree def execute(): + frappe.local.lang = frappe.db.get_default("lang") or 'en' + for doctype in ['department', 'leave_period', 'staffing_plan', 'job_opening', 'payroll_entry']: frappe.reload_doc("hr", "doctype", doctype) @@ -37,6 +39,8 @@ def execute(): update_instructors(comp_dict) + frappe.local.lang = 'en' + def update_records(doctype, comp_dict): when_then = [] for company in comp_dict: diff --git a/erpnext/patches/v11_0/update_department_lft_rgt.py b/erpnext/patches/v11_0/update_department_lft_rgt.py index 0cb9aeca4f..5a8837ee2c 100644 --- a/erpnext/patches/v11_0/update_department_lft_rgt.py +++ b/erpnext/patches/v11_0/update_department_lft_rgt.py @@ -10,7 +10,7 @@ def execute(): 'doctype': 'Department', 'department_name': _('All Departments'), 'is_group': 1 - }).insert(ignore_permissions=True) + }).insert(ignore_permissions=True, ignore_mandatory=True) frappe.db.sql("""update `tabDepartment` set parent_department = '{0}' where is_group = 0""".format(_('All Departments')))