19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:00 +01:00
parent a1137a1456
commit e1d89e11e3
2789 changed files with 1093187 additions and 605897 deletions

View file

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import hr_employee_cv_wizard

View file

@ -0,0 +1,44 @@
# -*- coding:utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from werkzeug.urls import url_encode
from odoo import _, api, fields, models
class HrEmployeeCvWizard(models.TransientModel):
_name = 'hr.employee.cv.wizard'
_description = 'Print Resume'
employee_ids = fields.Many2many('hr.employee')
color_primary = fields.Char('Primary Color', default=lambda self: self.env.company.primary_color or "#666666", required=True)
color_secondary = fields.Char('Secondary Color', default=lambda self: self.env.company.secondary_color or "#666666", required=True)
show_skills = fields.Boolean(string='Skills', default=True)
show_contact = fields.Boolean(string='Contact Information', default=True)
show_others = fields.Boolean(string='Others', default=True)
can_show_others = fields.Boolean(compute='_compute_can_show_others')
can_show_skills = fields.Boolean(compute='_compute_can_show_others')
@api.depends('employee_ids')
def _compute_can_show_others(self):
for wizard in self:
wizard.can_show_others = wizard.employee_ids.resume_line_ids.filtered(lambda l: not l.line_type_id)
wizard.can_show_skills = wizard.employee_ids.skill_ids
def action_validate(self):
self.ensure_one()
return {
'name': _('Print Resume'),
'type': 'ir.actions.act_url',
'url': '/print/cv?' + url_encode({
'employee_ids': ','.join(str(x) for x in self.employee_ids.ids),
'color_primary': self.color_primary,
'color_secondary': self.color_secondary,
'show_skills': 1 if self.show_skills else None,
'show_contact': 1 if self.show_contact else None,
'show_others': 1 if self.show_others else None,
})
}

View file

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="hr_employee_cv_wizard_view_form" model="ir.ui.view">
<field name="name">hr.employee.cv.wizard.view.form</field>
<field name="model">hr.employee.cv.wizard</field>
<field name="arch" type="xml">
<form string="Print Resume">
<field name="can_show_others" invisible="1"/>
<field name="can_show_skills" invisible="1"/>
<group>
<group>
<field name="employee_ids" widget="many2many_tags" invisible="1"/>
<label for="color_primary" string="Colors"/>
<div class="d-flex flex-row">
<field name="color_primary" widget="color" nolabel="1" style="width: 35px;"/>
<field name="color_secondary" widget="color" nolabel="1"/>
</div>
<field name="show_contact"/>
<field name="show_others" invisible="not can_show_others"/>
<field name="show_skills" invisible="not can_show_skills"/>
</group>
</group>
<footer>
<button name="action_validate" string="Print" type="object" class="oe_highlight" data-hotkey="q"/>
<button string="Discard" special="cancel" data-hotkey="x" class="btn-secondary"/>
</footer>
</form>
</field>
</record>
<record id="action_hr_employee_cv_wizard" model="ir.actions.act_window">
<field name="name">Print Resume</field>
<field name="res_model">hr.employee.cv.wizard</field>
<field name="view_mode">form</field>
<field name="context">{'default_employee_ids': active_ids}</field>
<field name="target">new</field>
</record>
</odoo>