From 2ec5a94a14d10f075c1a9bd8592c18dbd82d5a09 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 2 Sep 2022 13:24:29 +0530 Subject: [PATCH] Query check conditon datetime to date updated --- cor_custom/models/project.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cor_custom/models/project.py b/cor_custom/models/project.py index ccd94e8..e810341 100755 --- a/cor_custom/models/project.py +++ b/cor_custom/models/project.py @@ -363,10 +363,10 @@ class InheritProjectProductEmployeeMap(models.Model): date_clause = "" query_params = [val.project_id._origin.id, val.employee_id.id] if val.start_date: - date_clause += "and start_datetime >= %s" + date_clause += "and start_datetime::date >= %s" query_params.append(val.start_date) if val.end_date: - date_clause += " and end_datetime <= %s" + date_clause += " and end_datetime::date <= %s" query_params.append(val.end_date) query = """SELECT project_id, employee_id, SUM(unit_amount) FROM account_analytic_line where project_id = %s and employee_id = %s {date_clause}