From cdf16a972bb17864a08c1a93c171c6226a8de286 Mon Sep 17 00:00:00 2001 From: projectsodoo Date: Wed, 6 Jan 2021 21:46:40 +0530 Subject: [PATCH] Rem allocated updated --- project_forecast/models/project_forecast.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/project_forecast/models/project_forecast.py b/project_forecast/models/project_forecast.py index d1071cc..c7ef3c0 100755 --- a/project_forecast/models/project_forecast.py +++ b/project_forecast/models/project_forecast.py @@ -39,19 +39,19 @@ class PlanningShift(models.Model): if slot.project_id and slot.employee_id: if slot.project_id.project_type == 'hours_no_limit': slot.budgeted_hours = slot.project_id.budgeted_hours - rec = self.search([('project_id','=',slot.project_id.id)]) + rec = slot.search([('project_id','=',slot.project_id.id)]) all_hours = 0 for r in rec: all_hours += r.allocated_hours - slot.rem_all_hours = self.budgeted_hours - all_hours + slot.rem_all_hours = slot.budgeted_hours - all_hours if slot.project_id.project_type == 'hours_in_consultant': cons = self.env['project.sale.line.employee.map'].search([('employee_id','=',slot.employee_id.id),('project_id','=',slot.project_id.id)], limit=1) slot.budgeted_hours = cons and cons.budgeted_qty or 0 - rec = self.search([('employee_id', '=', slot.employee_id.id),('project_id', '=', slot.project_id.id)]) + rec = slot.search([('employee_id', '=', slot.employee_id.id),('project_id', '=', slot.project_id.id)]) all_hours = 0 for r in rec: all_hours += r.allocated_hours - slot.rem_all_hours = self.budgeted_hours - all_hours + slot.rem_all_hours = slot.budgeted_hours - all_hours else: slot.budgeted_hours = 0 slot.rem_all_hours = 0