mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +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,
|
||||
"autoname": "naming_series:",
|
||||
"creation": "2013-02-20 11:18:11",
|
||||
@@ -172,7 +173,8 @@
|
||||
"in_standard_filter": 1,
|
||||
"label": "Status",
|
||||
"no_copy": 1,
|
||||
"options": "Open\nApproved\nRejected\nCancelled"
|
||||
"options": "Open\nApproved\nRejected\nCancelled",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "sb10",
|
||||
@@ -191,8 +193,10 @@
|
||||
"fieldtype": "Link",
|
||||
"label": "Company",
|
||||
"options": "Company",
|
||||
"read_only": 1,
|
||||
"remember_last_selected_value": 1,
|
||||
"reqd": 1
|
||||
"reqd": 1,
|
||||
"fetch_from": "employee.company",
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
@@ -243,8 +247,9 @@
|
||||
"icon": "fa fa-calendar",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
"max_attachments": 3,
|
||||
"modified": "2019-08-13 13:32:04.860848",
|
||||
"modified": "2020-03-10 22:40:43.487721",
|
||||
"modified_by": "Administrator",
|
||||
"module": "HR",
|
||||
"name": "Leave Application",
|
||||
|
||||
@@ -13,7 +13,7 @@ def execute(filters=None):
|
||||
conditions, filters = get_conditions(filters)
|
||||
columns = get_columns(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"]]
|
||||
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
|
||||
|
||||
def get_employee_details():
|
||||
def get_employee_details(filters):
|
||||
emp_map = frappe._dict()
|
||||
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)
|
||||
|
||||
return emp_map
|
||||
|
||||
Reference in New Issue
Block a user