[FIX] hr_holidays: remove default working hours on stress days
If you create stress days, the default work calendar is set to be the company's default calendar, therefore exclude by default every employee with a different work calendar. Since the field is by default hidden, it is misleading, so by default no calendar should be set. task-2999197 closes odoo/odoo#101986 X-original-commit: 911832980786cc10bb79c7b36b2142d063917bff Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from random import randint
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class StressDay(models.Model):
|
||||
@@ -15,8 +14,9 @@ class StressDay(models.Model):
|
||||
start_date = fields.Date(required=True)
|
||||
end_date = fields.Date(required=True)
|
||||
color = fields.Integer(default=lambda dummy: randint(1, 11))
|
||||
resource_calendar_id = fields.Many2one('resource.calendar', 'Working Hours',
|
||||
default=lambda self: self.env.company.resource_calendar_id.id, domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]")
|
||||
resource_calendar_id = fields.Many2one(
|
||||
'resource.calendar', 'Working Hours',
|
||||
domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]")
|
||||
department_ids = fields.Many2many('hr.department', string="Departments")
|
||||
|
||||
_sql_constraints = [
|
||||
|
||||
Reference in New Issue
Block a user