1
0
forked from Mapan/odoo17e
odoo17e-kedaikipas58/addons/hr_contract_salary_holidays/models/res_company.py
2024-12-10 09:04:09 +07:00

19 lines
801 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class Company(models.Model):
_inherit = 'res.company'
hr_contract_timeoff_auto_allocation = fields.Boolean(string="Extra Time Off Allocation on contract signature")
hr_contract_timeoff_auto_allocation_type_id = fields.Many2one(
'hr.leave.type', string="Time Off Type", domain=[('requires_allocation', '=', 'yes')])
_sql_constraints = [
('auto_allocation',
"CHECK(hr_contract_timeoff_auto_allocation = 'f' OR hr_contract_timeoff_auto_allocation_type_id IS NOT NULL)",
"A Time Off Type is required once the Extra Time Off automatic allocation is set."),
]