Files
odoo_source/addons/hr_skills/models/hr_resume_line.py
T
pash-odoo 6f9e561783 [FIX] hr_skills: fix resume end date wrong selection
before this commit, in resume we are able to put end date less than start date
which is not possible in real life.
make change in constraint to check selected end date is greater than start date.
make changes in demo data of end date which are according to new changes.

task-3397726

closes odoo/odoo#136326

X-original-commit: 1cf56688126d3f0a1d27f4ed5ee995c4dcd956bc
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-09-25 15:20:19 +00:00

25 lines
973 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResumeLine(models.Model):
_name = 'hr.resume.line'
_description = "Resume line of an employee"
_order = "line_type_id, date_end desc, date_start desc"
employee_id = fields.Many2one('hr.employee', required=True, ondelete='cascade')
name = fields.Char(required=True, translate=True)
date_start = fields.Date(required=True)
date_end = fields.Date()
description = fields.Text(string="Description", translate=True)
line_type_id = fields.Many2one('hr.resume.line.type', string="Type")
# Used to apply specific template on a line
display_type = fields.Selection([('classic', 'Classic')], string="Display Type", default='classic')
_sql_constraints = [
('date_check', "CHECK ((date_start <= date_end OR date_end IS NULL))", "The start date must be anterior to the end date."),
]