mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-21 14:09:19 +00:00
fix(HR): Leave application company field made read-only and filter in Monthly attendance sheet (#20912)
* fix(HR): Leave application company field made Readonly * fix: in monthly report attandance employee filter based on company * fix: minor typo * fix: Fetch company from employee * Update monthly_attendance_sheet.py Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"actions": [],
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"autoname": "naming_series:",
|
"autoname": "naming_series:",
|
||||||
"creation": "2013-02-20 11:18:11",
|
"creation": "2013-02-20 11:18:11",
|
||||||
@@ -172,7 +173,8 @@
|
|||||||
"in_standard_filter": 1,
|
"in_standard_filter": 1,
|
||||||
"label": "Status",
|
"label": "Status",
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "Open\nApproved\nRejected\nCancelled"
|
"options": "Open\nApproved\nRejected\nCancelled",
|
||||||
|
"permlevel": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "sb10",
|
"fieldname": "sb10",
|
||||||
@@ -191,8 +193,10 @@
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Company",
|
"label": "Company",
|
||||||
"options": "Company",
|
"options": "Company",
|
||||||
|
"read_only": 1,
|
||||||
"remember_last_selected_value": 1,
|
"remember_last_selected_value": 1,
|
||||||
"reqd": 1
|
"reqd": 1,
|
||||||
|
"fetch_from": "employee.company",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 1,
|
||||||
@@ -243,8 +247,9 @@
|
|||||||
"icon": "fa fa-calendar",
|
"icon": "fa fa-calendar",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
|
"links": [],
|
||||||
"max_attachments": 3,
|
"max_attachments": 3,
|
||||||
"modified": "2019-08-13 13:32:04.860848",
|
"modified": "2020-03-10 22:40:43.487721",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Leave Application",
|
"name": "Leave Application",
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ def execute(filters=None):
|
|||||||
conditions, filters = get_conditions(filters)
|
conditions, filters = get_conditions(filters)
|
||||||
columns = get_columns(filters)
|
columns = get_columns(filters)
|
||||||
att_map = get_attendance_list(conditions, filters)
|
att_map = get_attendance_list(conditions, filters)
|
||||||
emp_map = get_employee_details()
|
emp_map = get_employee_details(filters)
|
||||||
|
|
||||||
holiday_list = [emp_map[d]["holiday_list"] for d in emp_map if emp_map[d]["holiday_list"]]
|
holiday_list = [emp_map[d]["holiday_list"] for d in emp_map if emp_map[d]["holiday_list"]]
|
||||||
default_holiday_list = frappe.get_cached_value('Company', filters.get("company"), "default_holiday_list")
|
default_holiday_list = frappe.get_cached_value('Company', filters.get("company"), "default_holiday_list")
|
||||||
@@ -140,10 +140,10 @@ def get_conditions(filters):
|
|||||||
|
|
||||||
return conditions, filters
|
return conditions, filters
|
||||||
|
|
||||||
def get_employee_details():
|
def get_employee_details(filters):
|
||||||
emp_map = frappe._dict()
|
emp_map = frappe._dict()
|
||||||
for d in frappe.db.sql("""select name, employee_name, designation, department, branch, company,
|
for d in frappe.db.sql("""select name, employee_name, designation, department, branch, company,
|
||||||
holiday_list from tabEmployee""", as_dict=1):
|
holiday_list from tabEmployee where company = %s""", (filters.get("company")), as_dict=1):
|
||||||
emp_map.setdefault(d.name, d)
|
emp_map.setdefault(d.name, d)
|
||||||
|
|
||||||
return emp_map
|
return emp_map
|
||||||
|
|||||||
Reference in New Issue
Block a user