From 4bd08182acc90859f66cd685707337a9cae09107 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 13 Sep 2016 13:35:53 +0530 Subject: [PATCH] [Fix] Timesheet calendar permission issue --- erpnext/projects/doctype/timesheet/timesheet.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py index 0379f906de..968974469c 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.py +++ b/erpnext/projects/doctype/timesheet/timesheet.py @@ -8,6 +8,7 @@ from frappe import _ import json from datetime import timedelta +from erpnext.controllers.queries import get_match_cond from frappe.utils import flt, time_diff_in_hours, get_datetime, getdate, cint, get_datetime_str from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc @@ -305,7 +306,8 @@ def get_events(start, end, filters=None): return frappe.db.sql("""select `tabTimesheet Detail`.name as name, `tabTimesheet Detail`.parent as parent, from_time, hours, activity_type, project, to_time from `tabTimesheet Detail`, `tabTimesheet` where `tabTimesheet Detail`.parent = `tabTimesheet`.name and - (from_time between %(start)s and %(end)s) {conditions}""".format(conditions=conditions), + (from_time between %(start)s and %(end)s) {conditions} + {match_cond}""".format(conditions=conditions, match_cond = get_match_cond('Timesheet')), { "start": start, "end": end