mirror of
https://github.com/bringout/oca-ocb-hr.git
synced 2026-04-26 17:32:06 +02:00
Initial commit: Hr packages
This commit is contained in:
commit
62531cd146
2820 changed files with 1432848 additions and 0 deletions
23
odoo-bringout-oca-ocb-hr/hr/models/hr_employee_category.py
Normal file
23
odoo-bringout-oca-ocb-hr/hr/models/hr_employee_category.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from random import randint
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class EmployeeCategory(models.Model):
|
||||
|
||||
_name = "hr.employee.category"
|
||||
_description = "Employee Category"
|
||||
|
||||
def _get_default_color(self):
|
||||
return randint(1, 11)
|
||||
|
||||
name = fields.Char(string="Tag Name", required=True)
|
||||
color = fields.Integer(string='Color Index', default=_get_default_color)
|
||||
employee_ids = fields.Many2many('hr.employee', 'employee_category_rel', 'category_id', 'emp_id', string='Employees')
|
||||
|
||||
_sql_constraints = [
|
||||
('name_uniq', 'unique (name)', "Tag name already exists !"),
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue