| 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details. |
| 2 |
|
| 3 |
from collections import defaultdict |
| 4 |
|
| 5 |
from odoo import _, models |
| 6 |
|
| 7 |
|
| 8 |
class ReportHr_SkillsReport_Employee_Cv(models.AbstractModel): |
| 9 |
_name = 'report.hr_skills.report_employee_cv' |
| 10 |
_description = 'Employee Resume' |
| 11 |
|
| 12 |
def _get_report_values(self, docids, data=None): |
| 13 |
show_others = (data or {}).get('show_others') |
| 14 |
employees = self.env['hr.employee'].browse(docids) |
| 15 |
|
| 16 |
resume_lines = {} |
| 17 |
for employee in employees: |
| 18 |
resume_lines[employee] = defaultdict(self.env['hr.resume.line'].browse) |
| 19 |
for line in employee.resume_line_ids: |
| 20 |
if not show_others and not line.line_type_id: |
| 21 |
continue |
| 22 |
resume_lines[employee][line.line_type_id.name or _('Other')] |= line |
| 23 |
|
| 24 |
return { |
| 25 |
'doc_ids': docids, |
| 26 |
'doc_model': 'hr.employee', |
| 27 |
'docs': employees, |
| 28 |
'resume_lines': resume_lines, |
| 29 |
} |