Query check conditon datetime to date updated
This commit is contained in:
parent
804f09921c
commit
2ec5a94a14
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue