From d283ee73f3e8018b1a2e0f4ae9c0e0d7eee30e39 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 23 Feb 2018 12:58:39 +0530 Subject: [PATCH] Fetch timesheet based on project --- erpnext/projects/doctype/timesheet/timesheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py index 3d94b5ce001..98e961d97fa 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.py +++ b/erpnext/projects/doctype/timesheet/timesheet.py @@ -290,7 +290,7 @@ def get_projectwise_timesheet_data(project, parent=None): cond = "and parent = %(parent)s" return frappe.db.sql("""select name, parent, billing_hours, billing_amount as billing_amt - from `tabTimesheet Detail` where docstatus=1 and project = %(project)s {0} and billable = 1 + from `tabTimesheet Detail` where parenttype = 'Timesheet' and docstatus=1 and project = %(project)s {0} and billable = 1 and sales_invoice is null""".format(cond), {'project': project, 'parent': parent}, as_dict=1) @frappe.whitelist()