diff options
| author | Aurélien (avd) <avd@odoo.com> | 2020-04-22 13:51:12 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2020-05-27 07:18:08 +0000 |
| commit | 647247e3ff5c6dd287973cf88e4ffa4504bd77f0 (patch) | |
| tree | 0b459b09051bfda338549bd17e8f7a369a09f745 /addons | |
| parent | e02137c48562d824e3e01054e31dae383e5843e2 (diff) | |
[IMP] hr_recruitment: Improve global UX (back2basics)
Multiple small changes/fixes to the hr_recruitment module to provide
a better base for later improvements.
The linkedin recruitment source is only added by default to new records,
existing records remain unchanged.
For the google map in the email template, since it requires an API_Key and
only a minority of companies will get this key, it was decided that
it is better to remove it from the template.
Now that linkedin is added to job positions by default, deleting a
job position currently does not delete the related linkedin source.
So after removing 10 job positions, there are still 10 linked in
source in the database. This commit fixes that.
Add three additionnal utm_sources.
Add linkedin as a source job to demo job position to be consistent with no-demo
data db.
closes odoo/odoo#50076
Taskid: 2196767
Related: odoo/enterprise#10778
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/hr_recruitment/data/hr_recruitment_data.xml | 16 | ||||
| -rw-r--r-- | addons/hr_recruitment/data/hr_recruitment_demo.xml | 35 | ||||
| -rw-r--r-- | addons/hr_recruitment/models/hr_job.py | 10 | ||||
| -rw-r--r-- | addons/hr_recruitment/models/hr_recruitment.py | 5 | ||||
| -rw-r--r-- | addons/hr_recruitment/views/hr_job_views.xml | 8 | ||||
| -rw-r--r-- | addons/hr_recruitment/views/hr_recruitment_views.xml | 23 | ||||
| -rw-r--r-- | addons/utm/data/utm_data.xml | 12 |
7 files changed, 74 insertions, 35 deletions
diff --git a/addons/hr_recruitment/data/hr_recruitment_data.xml b/addons/hr_recruitment/data/hr_recruitment_data.xml index 2428628ab79..0059e324493 100644 --- a/addons/hr_recruitment/data/hr_recruitment_data.xml +++ b/addons/hr_recruitment/data/hr_recruitment_data.xml @@ -116,7 +116,7 @@ <hr width="97%" style="background-color: rgb(204,204,204); border: medium none; clear: both; display: block; font-size: 0px; min-height: 1px; line-height: 0; margin: 16px 0px 16px 0px;"/> <h3 style="color:#9A6C8E;"><strong>What is the next step?</strong></h3> - We usually <strong>answer applications within 3 days</strong>. + We usually <strong>answer applications within a few days</strong>. <br/><br/> The next step is either a call or a meeting in our offices. <br/> @@ -156,12 +156,6 @@ % set location = '%s, %s' % (location, object.job_id.address_id.country_id.name) % endif <br/> - - % if object.job_id.address_id: - <a href="https://maps.google.com/maps?q=${location}" target="new"> - <img src="http://maps.googleapis.com/maps/api/staticmap?autoscale=1&size=598x200&maptype=roadmap&format=png&visual_refresh=true&markers=size:mid%7Ccolor:0xa5117d%7Clabel:%7C${location}" style="vertical-align:bottom;"/> - </a> - % endif </div> </td> </tr> @@ -214,7 +208,7 @@ % endif <h3 style="color:#9A6C8E;"><strong>What is the next step?</strong></h3> - We usually <strong>answer applications within 3 days.</strong><br/><br/> + We usually <strong>answer applications within a few days.</strong><br/><br/> Feel free to <strong>contact us if you want a faster feedback</strong> or if you don't get news from us quickly enough (just reply to this email). @@ -250,11 +244,6 @@ % set location = '%s, %s' % (location, object.job_id.address_id.country_id.name) % endif <br/> - % if object.job_id.address_id: - <a href="https://maps.google.com/maps?q=${location}" target="new"> - <img src="http://maps.googleapis.com/maps/api/staticmap?autoscale=1&size=598x200&maptype=roadmap&format=png&visual_refresh=true&markers=size:mid%7Ccolor:0xa5117d%7Clabel:%7C${location}" style="vertical-align:bottom;"/> - </a> - % endif </div> </td> </tr> @@ -362,7 +351,6 @@ </record> <record model="hr.recruitment.stage" id="stage_job2"> <field name="name">First Interview</field> - <field name="template_id" ref="email_template_data_applicant_interest"/> <field name="sequence">2</field> </record> <record model="hr.recruitment.stage" id="stage_job3"> diff --git a/addons/hr_recruitment/data/hr_recruitment_demo.xml b/addons/hr_recruitment/data/hr_recruitment_demo.xml index 193cfe6b3f4..1bd63aa1f2b 100644 --- a/addons/hr_recruitment/data/hr_recruitment_demo.xml +++ b/addons/hr_recruitment/data/hr_recruitment_demo.xml @@ -40,6 +40,41 @@ <field name="no_of_recruitment">6</field> </record> + <record id="hr_recruitment_linkedin_developer" model="hr.recruitment.source"> + <field name="source_id" ref="utm.utm_source_linkedin"/> + <field name="job_id" ref="hr.job_developer"/> + </record> + + <record id="hr_recruitment_linkedin_ceo" model="hr.recruitment.source"> + <field name="source_id" ref="utm.utm_source_linkedin"/> + <field name="job_id" ref="hr.job_ceo"/> + </record> + + <record id="hr_recruitment_linkedin_cto" model="hr.recruitment.source"> + <field name="source_id" ref="utm.utm_source_linkedin"/> + <field name="job_id" ref="hr.job_cto"/> + </record> + + <record id="hr_recruitment_linkedin_consultant" model="hr.recruitment.source"> + <field name="source_id" ref="utm.utm_source_linkedin"/> + <field name="job_id" ref="hr.job_consultant"/> + </record> + + <record id="hr_recruitment_linkedin_hrm" model="hr.recruitment.source"> + <field name="source_id" ref="utm.utm_source_linkedin"/> + <field name="job_id" ref="hr.job_hrm"/> + </record> + + <record id="hr_recruitment_linkedin_marketing" model="hr.recruitment.source"> + <field name="source_id" ref="utm.utm_source_linkedin"/> + <field name="job_id" ref="hr.job_marketing"/> + </record> + + <record id="hr_recruitment_linkedin_trainee" model="hr.recruitment.source"> + <field name="source_id" ref="utm.utm_source_linkedin"/> + <field name="job_id" ref="hr.job_trainee"/> + </record> + <record id="hr_case_salesman0" model="hr.applicant"> <field name="name">Sales Manager</field> <field name="job_id" ref="hr.job_marketing"/> diff --git a/addons/hr_recruitment/models/hr_job.py b/addons/hr_recruitment/models/hr_job.py index 5b7efdc78c8..aefd550d694 100644 --- a/addons/hr_recruitment/models/hr_job.py +++ b/addons/hr_recruitment/models/hr_job.py @@ -108,7 +108,15 @@ class Job(models.Model): @api.model def create(self, vals): vals['favorite_user_ids'] = vals.get('favorite_user_ids', []) + [(4, self.env.uid)] - return super(Job, self).create(vals) + new_job = super(Job, self).create(vals) + utm_linkedin = self.env.ref("utm.utm_source_linkedin", raise_if_not_found=False) + if utm_linkedin: + source_vals = { + 'source_id': utm_linkedin.id, + 'job_id': new_job.id, + } + self.env['hr.recruitment.source'].create(source_vals) + return new_job def _creation_subtype(self): return self.env.ref('hr_recruitment.mt_job_new') diff --git a/addons/hr_recruitment/models/hr_recruitment.py b/addons/hr_recruitment/models/hr_recruitment.py index a17e1a5e957..3623eaebd2c 100644 --- a/addons/hr_recruitment/models/hr_recruitment.py +++ b/addons/hr_recruitment/models/hr_recruitment.py @@ -22,7 +22,7 @@ class RecruitmentSource(models.Model): source_id = fields.Many2one('utm.source', "Source", ondelete='cascade', required=True) email = fields.Char(related='alias_id.display_name', string="Email", readonly=True) - job_id = fields.Many2one('hr.job', "Job ID") + job_id = fields.Many2one('hr.job', "Job", ondelete='cascade') alias_id = fields.Many2one('mail.alias', "Alias ID") def create_alias(self): @@ -44,7 +44,6 @@ class RecruitmentSource(models.Model): source.alias_id = self.env['mail.alias'].create(vals) source.name = source.source_id.name - class RecruitmentStage(models.Model): _name = "hr.recruitment.stage" _description = "Recruitment Stages" @@ -97,7 +96,7 @@ class Applicant(models.Model): _order = "priority desc, id desc" _inherit = ['mail.thread.cc', 'mail.activity.mixin', 'utm.mixin'] - name = fields.Char("Subject / Application Name", required=True) + name = fields.Char("Subject / Application Name", required=True, help="Email subject for applications sent via email") active = fields.Boolean("Active", default=True, help="If the active field is set to false, it will allow you to hide the case without removing it.") description = fields.Text("Description") email_from = fields.Char("Email", size=128, help="Applicant email", compute='_compute_partner_phone_email', diff --git a/addons/hr_recruitment/views/hr_job_views.xml b/addons/hr_recruitment/views/hr_job_views.xml index 462df73223c..9f874cf8eab 100644 --- a/addons/hr_recruitment/views/hr_job_views.xml +++ b/addons/hr_recruitment/views/hr_job_views.xml @@ -69,7 +69,7 @@ <div class="o_recruitment_kanban_box o_kanban_primary_bottom bottom_block" style="padding-left:8px;"> <div class="col-6"></div> <div class="col-6"> - <a type="action" name="%(action_hr_job_sources)d">Share Trackers</a> + <a type="action" name="%(action_hr_job_sources)d">Link Trackers</a> </div> </div> </div> @@ -102,12 +102,6 @@ <xpath expr="//field[@name='department_id']" position="after"> <filter string="My Job Positions" name="my_positions" domain="[('user_id', '=', uid)]"/> </xpath> - <xpath expr="//group" position="after"> - <searchpanel> - <field name="company_id" groups="base.group_multi_company" icon="fa-building"/> - <field name="user_id" icon="fa-users"/> - </searchpanel> - </xpath> </field> </record> diff --git a/addons/hr_recruitment/views/hr_recruitment_views.xml b/addons/hr_recruitment/views/hr_recruitment_views.xml index b4fc4ad76b2..3062ace075b 100644 --- a/addons/hr_recruitment/views/hr_recruitment_views.xml +++ b/addons/hr_recruitment/views/hr_recruitment_views.xml @@ -27,21 +27,23 @@ <tree string="Applicants" multi_edit="1"> <field name="message_needaction" invisible="1"/> <field name="last_stage_id" invisible="1"/> - <field name="create_date" readonly="1" widget="date"/> + <field name="create_date" readonly="1" widget="date" optional="show"/> <field name="date_last_stage_update" invisible="1"/> <field name="name" readonly="1"/> <field name="partner_name" readonly="1"/> - <field name="email_from" readonly="1"/> - <field name="partner_phone" widget="phone" readonly="1"/> + <field name="email_from" readonly="1" optional="hide"/> + <field name="partner_phone" widget="phone" readonly="1" optional="hide"/> <field name="job_id"/> <field name="stage_id"/> - <field name="medium_id"/> - <field name="source_id" readonly="1"/> - <field name="priority" widget="priority"/> + <field name="medium_id" optional="hide"/> + <field name="source_id" readonly="1" optional="hide"/> + <field name="priority" widget="priority" optional="show"/> + <field name="salary_expected" optional="show"/> + <field name="salary_proposed" optional="hide"/> <field name="type_id" invisible="1"/> - <field name="availability" invisible="1"/> + <field name="availability" optional="show"/> <field name="department_id" invisible="context.get('invisible_department', True)" readonly="1"/> - <field name="user_id" widget="many2one_avatar_user"/> + <field name="user_id" widget="many2one_avatar_user" optional="hide"/> <field name="company_id" groups="base.group_multi_company" readonly="1"/> </tree> </field> @@ -201,7 +203,7 @@ <separator/> <filter string="Unread Messages" name="message_needaction" domain="[('message_needaction', '=', True)]"/> <separator/> - <filter string="Archived" name="inactive" domain="[('active', '=', False)]"/> + <filter string="Archived / Refused" name="inactive" domain="[('active', '=', False)]"/> <separator/> <filter invisible="1" string="Late Activities" name="activities_overdue" domain="[('activity_ids.date_deadline', '<', context_today().strftime('%Y-%m-%d'))]" @@ -853,7 +855,8 @@ action = act <field name="model">hr.recruitment.source</field> <field name="arch" type="xml"> <tree string="Sources of Applicants" editable="top" class="o_recruitment_list"> - <field name="source_id"/> + <field name="source_id" placeholder="e.g. LinkedIn"/> + <field name="job_id"/> <button name="create_alias" title="Generate email alias" type="object" icon="fa-repeat" /> <field name="email"/> </tree> diff --git a/addons/utm/data/utm_data.xml b/addons/utm/data/utm_data.xml index cf7bafd7134..b9fb8274a31 100644 --- a/addons/utm/data/utm_data.xml +++ b/addons/utm/data/utm_data.xml @@ -24,6 +24,18 @@ <record model="utm.source" id="utm_source_twitter"> <field name="name">Twitter</field> </record> + <record model="utm.source" id="utm_source_linkedin"> + <field name="name">LinkedIn</field> + </record> + <record model="utm.source" id="utm_source_monster"> + <field name="name">Monster</field> + </record> + <record model="utm.source" id="utm_source_glassdoor"> + <field name="name">Glassdoor</field> + </record> + <record model="utm.source" id="utm_source_craigslist"> + <field name="name">Craigslist</field> + </record> <!-- UTM Medium --> <record model="utm.medium" id="utm_medium_website"> |
