From ec29deb02445e237fb53f3106849f7ab327dd597 Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Fri, 15 May 2020 14:01:05 +0000 Subject: [PATCH] [FIX] hr: activity type configuration on hr plans - Employees > Configuration > Planning Types and ensure the activity type "To Do" is set to scheduled date several days after previous activity (default should be 5 days); - Check that onboarding Plan has at least 2 activities with activity type "To Do"; - Click launch plan. Before this commit, the activity type configuration is ignored and all activities are due tomorrow. Now, the activities are due taking into account the activity type configuration. opw-2255586 closes odoo/odoo#51423 X-original-commit: c159479d7f714f2ec871cc4b965de3f961160789 Signed-off-by: Jorge Pinna Puissant (jpp) --- addons/hr/wizard/hr_plan_wizard.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/hr/wizard/hr_plan_wizard.py b/addons/hr/wizard/hr_plan_wizard.py index c0f2d663e4c..3390196a9c8 100644 --- a/addons/hr/wizard/hr_plan_wizard.py +++ b/addons/hr/wizard/hr_plan_wizard.py @@ -24,12 +24,13 @@ class HrPlanWizard(models.TransientModel): responsible = activity_type.get_responsible_id(self.employee_id) if self.env['hr.employee'].with_user(responsible).check_access_rights('read', raise_exception=False): - self.employee_id.activity_schedule( + activity = self.employee_id.activity_schedule( activity_type_id=activity_type.activity_type_id.id, summary=activity_type.summary, note=activity_type.note, user_id=responsible.id ) + activity._onchange_activity_type_id() return { 'type': 'ir.actions.act_window',