print removed and report updated

This commit is contained in:
projectsodoo 2021-01-06 17:37:18 +05:30
parent 835db1d771
commit 7b233730c4
2 changed files with 1 additions and 5 deletions

View File

@ -85,17 +85,13 @@ class PlanningShift(models.Model):
if self.project_id:
consul_ids = self.env['project.sale.line.employee.map'].search([('project_id', '=', self.project_id.id)])
consul_project_ids = [val.employee_id.id for val in consul_ids]
print("consul_project_ids", consul_project_ids)
if self.project_id and self.project_id.user_id:
manager_id = self.env['hr.employee'].search([('user_id', '=', self.project_id.user_id.id)]).ids
print("manager_id", manager_id)
if self.project_id and self.project_id.privacy_visibility in ('employees', 'portal'):
user_ids = self.env['hr.employee'].search([('user_id', '!=', False)]).ids
if self.project_id and self.project_id.privacy_visibility == 'followers':
print("project_all_emp_ids", self.project_id.allowed_internal_user_ids, self.project_id.allowed_internal_user_ids.ids)
user_ids = self.env['hr.employee'].search([('user_id', 'in', self.project_id.allowed_internal_user_ids.ids)]).ids
project_all_emp_ids = manager_id + user_ids + consul_project_ids
print("project_all_emp_idsproject_all_emp_ids", project_all_emp_ids, domain)
result = {
'domain': {'task_id': domain, 'employee_id': [('id', 'in', project_all_emp_ids)]},
}

View File

@ -68,7 +68,7 @@ class BudgetHrsAnalysis(models.Model):
PRO.partner_id AS partner_id,
AAL.employee_id AS employee_id,
'Actual Hours' as hours_type,
sum(AAL.unit_amount) AS hours
AAL.unit_amount AS hours
FROM
project_project PRO
Left JOIN project_sale_line_employee_map Pro_emp ON Pro_emp.project_id = Pro.id