From d5437330937a1387a6ed4e3684cd104e8d37090b Mon Sep 17 00:00:00 2001 From: Hetashree Chauhan Date: Fri, 13 Jul 2018 14:14:12 +0200 Subject: [PATCH] [REM] hr_recruitment: remove broadcast of new employees on hardcoded channel This is specific and updating the content is not easy for non technical people. As same result can be achieved with a server action based on employee creation it has been decided to remove the broadcast, and therefore the template and code linked to it. This commit is linked to task ID 1843122 (and 1868112) and to PR #25295 (and #25889). --- .../data/hr_recruitment_data.xml | 19 ------------------- addons/hr_recruitment/models/hr_employee.py | 17 ----------------- .../hr_recruitment/models/hr_recruitment.py | 1 - 3 files changed, 37 deletions(-) diff --git a/addons/hr_recruitment/data/hr_recruitment_data.xml b/addons/hr_recruitment/data/hr_recruitment_data.xml index 8eac525a86e..786a623cd2e 100644 --- a/addons/hr_recruitment/data/hr_recruitment_data.xml +++ b/addons/hr_recruitment/data/hr_recruitment_data.xml @@ -282,25 +282,6 @@ ${object.partner_id.lang or ''} - - Applicant: Welcome new employee - - Welcome ${object.name} - -
- Hello all,

- I’m very pleased to announce that ${object.name} will be - joining us as a ${object.job_id.name} - %if object.department_id: - in ${object.department_id.name}. - %endif -

- Please welcome him/her and help him/her finding his/her marks. -
-
- - - Graduate 1 diff --git a/addons/hr_recruitment/models/hr_employee.py b/addons/hr_recruitment/models/hr_employee.py index 0d90897631e..73104b1a31f 100644 --- a/addons/hr_recruitment/models/hr_employee.py +++ b/addons/hr_recruitment/models/hr_employee.py @@ -21,20 +21,3 @@ class HrEmployee(models.Model): def _search_newly_hired_employee(self, operator, value): applicants = self.env['hr.applicant'].search([('job_id.state', '=', 'recruit')]) return [('id', 'in', applicants.ids)] - - @api.multi - def _broadcast_welcome(self): - """ Broadcast the welcome message to all users in the employee company. """ - self.ensure_one() - IrModelData = self.env['ir.model.data'] - channel_all_employees = IrModelData.xmlid_to_object('mail.channel_all_employees') - template_new_employee = IrModelData.xmlid_to_object('hr_recruitment.email_template_data_applicant_employee') - if template_new_employee: - MailTemplate = self.env['mail.template'] - body_html = MailTemplate.render_template(template_new_employee.body_html, 'hr.employee', self.id) - subject = MailTemplate.render_template(template_new_employee.subject, 'hr.employee', self.id) - channel_all_employees.message_post( - body=body_html, subject=subject, - subtype='mail.mt_comment', - notif_layout='mail.mail_notification_light') - return True diff --git a/addons/hr_recruitment/models/hr_recruitment.py b/addons/hr_recruitment/models/hr_recruitment.py index c13fb3e417d..67ca1548bfd 100644 --- a/addons/hr_recruitment/models/hr_recruitment.py +++ b/addons/hr_recruitment/models/hr_recruitment.py @@ -449,7 +449,6 @@ class Applicant(models.Model): applicant.job_id.message_post( body=_('New Employee %s Hired') % applicant.partner_name if applicant.partner_name else applicant.name, subtype="hr_recruitment.mt_job_applicant_hired") - employee._broadcast_welcome() else: raise UserError(_('You must define an Applied Job and a Contact Name for this applicant.'))