Report updated start and end datetime

This commit is contained in:
projectsodoo 2021-02-22 10:35:15 +05:30
parent fab3b4cac2
commit 769f93e6f2
2 changed files with 14 additions and 4 deletions

View File

@ -85,8 +85,8 @@ class ProjectConsultantHrs(models.Model):
domain = [
('project_id','=',val.project_id.id),
('employee_id', '=', val.employee_id.id),
('date', '>=', val.start_date),
('date', '<=', val.end_date)
('start_datetime', '>=', val.start_date),
('end_datetime', '<=', val.end_date)
]
timesheets = Timesheet.search(domain)
val.actual_hours = sum(timesheet.unit_amount for timesheet in timesheets)

View File

@ -50,10 +50,12 @@ class BudgetHrsAnalysis(models.Model):
ROW_NUMBER() OVER() as id,
project_id,
parent_project,
startdate as start_date,
enddate as end_date,
--is_sub_project,
--sub_project,
date_start AS start_date,
date AS end_date,
--date_start AS start_date,
--date AS end_date,
timesheet_date,
pricing_type as pricing_type,
project_type as project_type,
@ -65,6 +67,8 @@ class BudgetHrsAnalysis(models.Model):
pro.id AS project_id,
(select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project,
pro_emp.employee_id AS employee_id,
date_start AS startdate,
date AS enddate,
'Budgeted Hours' as hours_type,
null::date AS timesheet_date,
pro_emp.budgeted_qty as hours,
@ -80,6 +84,8 @@ class BudgetHrsAnalysis(models.Model):
pro.id AS project_id,
(select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project,
null::int AS employee_id,
date_start AS startdate,
date AS enddate,
'Budgeted Hours' as hours_type,
null::date AS timesheet_date,
pro.budgeted_hours2 as hours,
@ -95,6 +101,8 @@ class BudgetHrsAnalysis(models.Model):
pro.id AS project_id,
(select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project,
AAL.employee_id AS employee_id,
start_datetime AS startdate,
end_datetime AS enddate,
'Actual Hours' as hours_type,
AAL.date AS timesheet_date,
unit_amount as hours,
@ -111,6 +119,8 @@ class BudgetHrsAnalysis(models.Model):
pro.id AS project_id,
(select project_id from project_subproject_rel as par where pro.id=par.id limit 1) as parent_project,
AAL.employee_id AS employee_id,
start_datetime::DATE AS startdate,
end_datetime::DATE AS enddate,
'Actual Hours' as hours_type,
AAL.date AS timesheet_date,
unit_amount as hours,