Merge pull request #6355 from rohitwaghchaure/timesheet_calendar_permission_issue

[Fix] Timesheet calendar permission issue
This commit is contained in:
Nabin Hait 2016-09-14 15:26:30 +05:30 committed by GitHub
commit 9c32baa1f4

View File

@ -8,6 +8,7 @@ from frappe import _
import json import json
from datetime import timedelta 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.utils import flt, time_diff_in_hours, get_datetime, getdate, cint, get_datetime_str
from frappe.model.document import Document from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc from frappe.model.mapper import get_mapped_doc
@ -310,7 +311,8 @@ def get_events(start, end, filters=None):
return frappe.db.sql("""select `tabTimesheet Detail`.name as name, `tabTimesheet Detail`.parent as parent, 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`, from_time, hours, activity_type, project, to_time from `tabTimesheet Detail`,
`tabTimesheet` where `tabTimesheet Detail`.parent = `tabTimesheet`.name and `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, "start": start,
"end": end "end": end