From 869c7316cd9dd38e832f8be22af2e6b6f313bd5c Mon Sep 17 00:00:00 2001 From: "Rohitkumar (roku)" Date: Fri, 17 Feb 2023 09:03:07 +0000 Subject: [PATCH] [FIX] hr: fix the on/off boarding warning in employee Steps to reproduce: - Install Employees App Configuration - Got to the Employees > Configuration > Activity Planning > Set the On/Offboarding Plans - Create Test Employee With No Catch - Click on Launch Plan action - Check the Warning in Launch Plan Wizard When employee's coach or manager empty then warning is appeared coach's/manager's user is not set.In this commit we have shown in the warning that the coach/manager is not set. task-3193218 closes odoo/odoo#115889 X-original-commit: 421c238129676a83df63f00abadd539e82ced2eb Signed-off-by: Kevin Baptiste --- addons/hr/i18n/hr.pot | 2 +- addons/hr/models/hr_plan_activity_type.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/hr/i18n/hr.pot b/addons/hr/i18n/hr.pot index 7d01e6fd4fb..7051e1dab9d 100644 --- a/addons/hr/i18n/hr.pot +++ b/addons/hr/i18n/hr.pot @@ -2546,7 +2546,7 @@ msgstr "" #. odoo-python #: code:addons/hr/models/hr_plan_activity_type.py:0 #, python-format -msgid "User of coach of employee %s is not set." +msgid "The user of %s's coach is not set." msgstr "" #. module: hr diff --git a/addons/hr/models/hr_plan_activity_type.py b/addons/hr/models/hr_plan_activity_type.py index cab65ff80f0..572f72504eb 100644 --- a/addons/hr/models/hr_plan_activity_type.py +++ b/addons/hr/models/hr_plan_activity_type.py @@ -44,13 +44,13 @@ class HrPlanActivityType(models.Model): if not employee.coach_id: warning = _('Coach of employee %s is not set.', employee.name) responsible = employee.coach_id.user_id - if not responsible: - warning = _('User of coach of employee %s is not set.', employee.name) + if employee.coach_id and not responsible: + warning = _("The user of %s's coach is not set.", employee.name) elif self.responsible == 'manager': if not employee.parent_id: warning = _('Manager of employee %s is not set.', employee.name) responsible = employee.parent_id.user_id - if not responsible: + if employee.parent_id and not responsible: warning = _("The manager of %s should be linked to a user.", employee.name) elif self.responsible == 'employee': responsible = employee.user_id