diff --git a/erpnext/setup/doctype/department/department.js b/erpnext/setup/doctype/department/department.js index 46cfbdad56..322eea59bb 100644 --- a/erpnext/setup/doctype/department/department.js +++ b/erpnext/setup/doctype/department/department.js @@ -1,20 +1,11 @@ // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors // For license information, please see license.txt -frappe.ui.form.on('Department', { +frappe.ui.form.on("Department", { onload: function(frm) { - frm.set_query("parent_department", function(){ + frm.set_query("parent_department", function() { return {"filters": [["Department", "is_group", "=", 1]]}; }); - - frm.set_query("payroll_cost_center", function() { - return { - filters: { - "company": frm.doc.company, - "is_group": 0 - } - }; - }); }, refresh: function(frm) { // read-only for root department diff --git a/erpnext/setup/doctype/employee/employee.js b/erpnext/setup/doctype/employee/employee.js index 637993ead3..8d152959d6 100755 --- a/erpnext/setup/doctype/employee/employee.js +++ b/erpnext/setup/doctype/employee/employee.js @@ -38,25 +38,7 @@ erpnext.setup.EmployeeController = class EmployeeController extends frappe.ui.fo }; -frappe.ui.form.on('Employee', { - setup: function (frm) { - frm.set_query("leave_policy", function() { - return { - "filters": { - "docstatus": 1 - } - }; - }); - - frm.set_query("payroll_cost_center", function() { - return { - filters: { - "company": frm.doc.company, - "is_group": 0 - } - }; - }); - }, +frappe.ui.form.on("Employee", { onload: function (frm) { frm.set_query("department", function() { return { diff --git a/erpnext/setup/doctype/employee/employee.json b/erpnext/setup/doctype/employee/employee.json index fa2834eef6..37a2e332c1 100644 --- a/erpnext/setup/doctype/employee/employee.json +++ b/erpnext/setup/doctype/employee/employee.json @@ -48,11 +48,6 @@ "reports_to", "column_break_31", "branch", - "approvers_section", - "expense_approver", - "leave_approver", - "column_break_45", - "shift_request_approver", "attendance_and_leave_details", "attendance_device_id", "column_break_44", @@ -60,7 +55,6 @@ "salary_information", "salary_currency", "ctc", - "salary_mode", "payroll_cost_center", "column_break_52", "bank_name", @@ -715,49 +709,14 @@ "fieldname": "column_break_44", "fieldtype": "Column Break" }, - { - "fieldname": "leave_approver", - "fieldtype": "Link", - "label": "Leave Approver", - "options": "User" - }, { "fieldname": "column_break_19", "fieldtype": "Column Break" }, - { - "fetch_from": "department.payroll_cost_center", - "fetch_if_empty": 1, - "fieldname": "payroll_cost_center", - "fieldtype": "Link", - "label": "Payroll Cost Center", - "options": "Cost Center" - }, { "fieldname": "column_break_52", "fieldtype": "Column Break" }, - { - "fieldname": "expense_approver", - "fieldtype": "Link", - "label": "Expense Approver", - "options": "User" - }, - { - "fieldname": "approvers_section", - "fieldtype": "Section Break", - "label": "Approvers" - }, - { - "fieldname": "column_break_45", - "fieldtype": "Column Break" - }, - { - "fieldname": "shift_request_approver", - "fieldtype": "Link", - "label": "Shift Request Approver", - "options": "User" - }, { "fieldname": "salary_currency", "fieldtype": "Link", @@ -775,7 +734,7 @@ "idx": 24, "image_field": "image", "links": [], - "modified": "2022-06-10 22:28:55.811983", + "modified": "2022-06-23 22:28:55.811983", "modified_by": "Administrator", "module": "Setup", "name": "Employee", diff --git a/erpnext/setup/doctype/employee/employee.py b/erpnext/setup/doctype/employee/employee.py index d6a911dde4..91e8cf393d 100755 --- a/erpnext/setup/doctype/employee/employee.py +++ b/erpnext/setup/doctype/employee/employee.py @@ -94,7 +94,6 @@ class Employee(NestedSet): self.update_user() self.update_user_permissions() self.reset_employee_emails_cache() - self.update_approver_role() def update_user_permissions(self): if not self.create_user_permission: @@ -155,17 +154,6 @@ class Employee(NestedSet): user.save() - def update_approver_role(self): - if self.leave_approver: - user = frappe.get_doc("User", self.leave_approver) - user.flags.ignore_permissions = True - user.add_roles("Leave Approver") - - if self.expense_approver: - user = frappe.get_doc("User", self.expense_approver) - user.flags.ignore_permissions = True - user.add_roles("Expense Approver") - def validate_date(self): if self.date_of_birth and getdate(self.date_of_birth) > getdate(today()): throw(_("Date of Birth cannot be greater than today."))