mirror of
https://github.com/bringout/oca-workflow-process.git
synced 2026-04-19 11:51:59 +02:00
Initial commit: OCA Workflow Process packages (456 packages)
This commit is contained in:
commit
d366e42934
18799 changed files with 1284507 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
# Copyright 2018 Tecnativa - Pedro M. Baeza
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ResUsers(models.Model):
|
||||
_inherit = "res.users"
|
||||
|
||||
hr_category_ids = fields.Many2many(
|
||||
comodel_name="hr.employee.category",
|
||||
string="HR categories",
|
||||
compute="_compute_hr_category_ids",
|
||||
help="Technical field for computing dynamically employee categories "
|
||||
"linked to the user in the current company.",
|
||||
)
|
||||
|
||||
@api.depends("company_id", "employee_ids", "employee_ids.category_ids")
|
||||
def _compute_hr_category_ids(self):
|
||||
for user in self:
|
||||
user.hr_category_ids = user.employee_ids.filtered(
|
||||
lambda x: x.company_id == user.company_id
|
||||
)[:1].category_ids
|
||||
Loading…
Add table
Add a link
Reference in a new issue