16.0 dev recup #4

Closed
LaetitiaElabore wants to merge 11 commits from 16.0-dev-recup into 16.0
2 changed files with 20 additions and 1 deletions
Showing only changes of commit 161a48f222 - Show all commits

View File

@@ -1 +1 @@
from . import hr_leave_type, hr_leave
from . import hr_leave_type, hr_leave, hr_leave_allocation

View File

@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com)
from odoo import models
class HrLeaveAllocation(models.Model):
_inherit = "hr.leave.allocation"
_sql_constraints = [
('type_value',
"CHECK( (holiday_type='employee' AND (employee_id IS NOT NULL OR multi_employee IS TRUE)) or "
"(holiday_type='category' AND category_id IS NOT NULL) or "
"(holiday_type='department' AND department_id IS NOT NULL) or "
"(holiday_type='company' AND mode_company_id IS NOT NULL))",
"The employee, department, company or employee category of this request is missing. Please make sure that your user login is linked to an employee."),
('duration_check', "CHECK((allocation_type != 'regular'))", "The duration must be greater than 0."),
]