diff --git a/cor_custom/models/project.py b/cor_custom/models/project.py index dff23db..fb661ff 100755 --- a/cor_custom/models/project.py +++ b/cor_custom/models/project.py @@ -196,6 +196,12 @@ class Project(models.Model): val.consultant_timesheet_hrs = False # val.consultant_timesheet_hrs = False + 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, + 'default_res_model': 'project.consultant.hrs.report'} + return action class ProjectConsultantTimesheetHrs(models.Model): _name = 'consultant.timesheet.hrs' @@ -333,5 +339,6 @@ class InheritProjectTask(models.Model): def action_done_task(self): stage_id = self.env['project.task.type'].search([('is_closed', '=', True)], limit=1) for stage in self: - stage.write({'stage_id' : stage_id.id}) + stage.write({'stage_id': stage_id.id, + 'active': False})