hr_recruitment/models/hr_applicant_category.py
Данил Воробьев cd7aff508a initial commit
2024-05-14 11:11:34 +00:00

21 lines
572 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
from random import randint
class ApplicantCategory(models.Model):
_name = "hr.applicant.category"
_description = "Category of applicant"
def _get_default_color(self):
return randint(1, 11)
name = fields.Char("Tag Name", required=True)
color = fields.Integer(string='Color Index', default=_get_default_color)
_sql_constraints = [
('name_uniq', 'unique (name)', "Tag name already exists!"),
]