[IMP] hr(_skills): Allow grouby skills and tags
closes odoo/odoo#93684 Taskid: 2880658 Related: odoo/enterprise#28436 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
<filter name="group_manager" string="Manager" domain="[]" context="{'group_by': 'parent_id'}"/>
|
||||
<filter name="group_department" string="Department" domain="[]" context="{'group_by': 'department_id'}"/>
|
||||
<filter name="group_job" string="Job" domain="[]" context="{'group_by': 'job_id'}"/>
|
||||
<filter name="group_category_ids" string="Tags" domain="[]" context="{'group_by': 'category_ids'}"/>
|
||||
</group>
|
||||
<searchpanel>
|
||||
<field name="company_id" groups="base.group_multi_company" icon="fa-building" enable_counters="1"/>
|
||||
|
||||
@@ -262,6 +262,7 @@
|
||||
<filter string="Job" name="job" domain="[]" context="{'group_by': 'job_id'}"/>
|
||||
<filter string="Degree" name="degree" domain="[]" context="{'group_by': 'type_id'}"/>
|
||||
<filter string="Stage" name="stage" domain="[]" context="{'group_by': 'stage_id'}"/>
|
||||
<filter string="Tags" name="group_by_categ_ids" context="{'group_by':'categ_ids'}"/>
|
||||
<filter string="Refuse Reason" name="refuse_reason_id" domain="[]" context="{'group_by': 'refuse_reason_id'}"/>
|
||||
<filter string="Creation Date" name="creation_date" context="{'group_by': 'create_date'}"/>
|
||||
<filter string="Last Stage Update" name="last_stage_update" context="{'group_by': 'date_last_stage_update'}"/>
|
||||
@@ -1101,6 +1102,7 @@
|
||||
<filter string="Company" name="company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Jobs" name="job" context="{'group_by':'job_id'}"/>
|
||||
<filter string="Department" name="department" context="{'group_by':'department_id'}"/>
|
||||
<filter string="Tags" name="group_by_categ_ids" context="{'group_by':'categ_ids'}"/>
|
||||
<filter string="Stage" name="stage" context="{'group_by':'stage_id'}" />
|
||||
<separator/>
|
||||
<filter string="Creation Date" name="creation_month" context="{'group_by':'create_date:month'}" help="Creation Date"/>
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
from odoo import fields, models, api
|
||||
|
||||
|
||||
class HrApplicant(models.Model):
|
||||
_inherit = 'hr.applicant'
|
||||
|
||||
applicant_skill_ids = fields.One2many('hr.applicant.skill', 'applicant_id', string="Skills")
|
||||
skill_ids = fields.Many2many('hr.skill', compute='_compute_skill_ids', store=True)
|
||||
|
||||
@api.depends('applicant_skill_ids.skill_id')
|
||||
def _compute_skill_ids(self):
|
||||
for applicant in self:
|
||||
applicant.skill_ids = applicant.applicant_skill_ids.skill_id
|
||||
|
||||
def create_employee_from_applicant(self):
|
||||
self.ensure_one()
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
<xpath expr="//field[@name='email_from']" position="after">
|
||||
<field name="applicant_skill_ids"/>
|
||||
</xpath>
|
||||
<filter name="last_stage_update" position="after">
|
||||
<filter string="Skills" name="groupby_skills" context="{'group_by': 'skill_ids'}"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -44,6 +47,9 @@
|
||||
<xpath expr="//field[@name='user_id']" position="after">
|
||||
<field name="applicant_skill_ids"/>
|
||||
</xpath>
|
||||
<filter name="stage" position="after">
|
||||
<filter string="Skills" name="groupby_skills" context="{'group_by': 'skill_ids'}"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -9,6 +9,12 @@ class Employee(models.Model):
|
||||
|
||||
resume_line_ids = fields.One2many('hr.resume.line', 'employee_id', string="Resumé lines")
|
||||
employee_skill_ids = fields.One2many('hr.employee.skill', 'employee_id', string="Skills")
|
||||
skill_ids = fields.Many2many('hr.skill', compute='_compute_skill_ids', store=True)
|
||||
|
||||
@api.depends('employee_skill_ids.skill_id')
|
||||
def _compute_skill_ids(self):
|
||||
for employee in self:
|
||||
employee.skill_ids = employee.employee_skill_ids.skill_id
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
<field name="employee_skill_ids"/>
|
||||
<field name="resume_line_ids" string="Resumé" filter_domain="['|', ('resume_line_ids.name', 'ilike', self), ('resume_line_ids.description', 'ilike', self)]"/>
|
||||
</xpath>
|
||||
<filter name="group_job" position="after">
|
||||
<filter name="group_by_skill_ids" string="Skills" domain="[]" context="{'group_by': 'skill_ids'}"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user