summaryrefslogtreecommitdiff
path: root/hr_employee_updation/models/hr_contract_days.py
blob: 11f161cdd1a504cf27b5d3c10bb71dc3dc133faf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from odoo.exceptions import Warning
from odoo import models, fields, api, _


class HrEmployeeContract(models.Model):
    _inherit = 'hr.contract'

    def _get_default_notice_days(self):
        if self.env['ir.config_parameter'].get_param(
                'hr_resignation.notice_period'):
            return self.env['ir.config_parameter'].get_param(
                            'hr_resignation.no_of_days')
        else:
            return 0

    notice_days = fields.Integer(string="Notice Period", default=_get_default_notice_days)