mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 07:54:46 +00:00
Filter issue on timesheet calendar view (#8730)
This commit is contained in:
@@ -382,9 +382,13 @@ def get_events(start, end, filters=None):
|
|||||||
|
|
||||||
def get_conditions(filters):
|
def get_conditions(filters):
|
||||||
conditions = []
|
conditions = []
|
||||||
abbr = {'employee': 'tabTimesheet', 'project': 'tabTimesheet Detail'}
|
|
||||||
for key in filters:
|
for key in filters:
|
||||||
if filters.get(key):
|
if filters.get(key):
|
||||||
conditions.append("`%s`.%s = '%s'"%(abbr.get(key), key, filters.get(key)))
|
if frappe.get_meta("Timesheet").has_field(key):
|
||||||
|
dt = 'tabTimesheet'
|
||||||
|
elif frappe.get_meta("Timesheet Detail").has_field(key):
|
||||||
|
dt = 'tabTimesheet Detail'
|
||||||
|
|
||||||
|
conditions.append("`%s`.%s = '%s'"%(dt, key, filters.get(key)))
|
||||||
|
|
||||||
return " and {}".format(" and ".join(conditions)) if conditions else ""
|
return " and {}".format(" and ".join(conditions)) if conditions else ""
|
||||||
|
|||||||
Reference in New Issue
Block a user