diff --git a/cor_custom/models/project.py b/cor_custom/models/project.py index 3b85e57..7809738 100755 --- a/cor_custom/models/project.py +++ b/cor_custom/models/project.py @@ -262,7 +262,9 @@ class Project(models.Model): def action_view_custom_project_consultant_hrs_report(self): action = self.env["ir.actions.actions"]._for_xml_id("cor_custom.action_project_consultant_hrs_report") action['context'] = {'search_default_project_id': self.id, 'search_default_project': 1, - 'search_default_consultant': 1, 'search_default_group_by_hours_type': 1, + 'search_default_consultant': 1, + #'search_default_sdate': 1, + #'search_default_group_by_hours_type': 1, 'default_res_model': 'project.consultant.hrs.report'} return action diff --git a/cor_custom/report/project_hours_report_view.xml b/cor_custom/report/project_hours_report_view.xml index 8aeb24a..460108f 100755 --- a/cor_custom/report/project_hours_report_view.xml +++ b/cor_custom/report/project_hours_report_view.xml @@ -1,6 +1,20 @@ + + project.consultant.hrs.report.pivot + project.consultant.hrs.report + + + + + + + + + + + project.consultant.hrs.report.form project.consultant.hrs.report @@ -45,7 +59,7 @@ - + @@ -88,14 +102,9 @@ Consultant Allocation ir.actions.act_window project.consultant.hrs.report - tree,calendar,graph + pivot,tree,calendar,graph - { - 'search_default_project': 1, - 'search_default_consultant': 1, - 'search_default_group_by_hours_type': 1, - 'default_res_model': 'project.consultant.hrs.report' - } + {'search_default_project': 1, 'search_default_consultant': 1, 'default_res_model': 'project.consultant.hrs.report'} diff --git a/cor_custom/wizard/project_multi_budget_assign.py b/cor_custom/wizard/project_multi_budget_assign.py index 1129099..fd488e0 100755 --- a/cor_custom/wizard/project_multi_budget_assign.py +++ b/cor_custom/wizard/project_multi_budget_assign.py @@ -20,11 +20,13 @@ class ProjectMultiBudgetAssign(models.TransientModel): res_id = self._context.get('active_id') record = self.env['project.project'].browse(res_id) lines = [] + emp_id = [] for rec in record.sale_line_employee_ids: cons = {} all_cons = self.env['project.consultant.hrs'].search([('employee_id','=',rec.employee_id.id),('project_id','=',rec.project_id.id)]) all_per = [v.percentage for v in all_cons] - if sum(all_per) < 100: + if sum(all_per) < 100 and (rec.employee_id and rec.employee_id.id not in emp_id): + emp_id.append(rec.employee_id.id) cons.update({'employee_id': rec.employee_id.id, 'emp_map_id':rec.id, 'project_id':res_id}) lines.append((0, 0, cons)) if record and (not record.pricing_type == 'employee_rate' or not record.project_type == 'hours_in_consultant'):