Files
tra_backend/hr_employee_updation/models/hr_contract_days.py
2020-07-21 10:09:46 +00:00

17 lines
537 B
Python

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)