添加功能
This commit is contained in:
@@ -657,7 +657,8 @@ class YuthonVacationReports(models.Model):
|
||||
def automatic_confirmation(self):
|
||||
current_date = fields.Date.today()
|
||||
vacation_ids = self.env["yuthon.vacation.reports"].search([
|
||||
('vacation_date', '=', current_date.replace(day=1))
|
||||
('vacation_date', '=', current_date.replace(day=1)),
|
||||
('vacation_state', '=', 'unconfirmed')
|
||||
])
|
||||
for rec in vacation_ids:
|
||||
month_start = current_date.replace(day=1)
|
||||
@@ -682,11 +683,9 @@ class YuthonVacationReports(models.Model):
|
||||
for employee in employees:
|
||||
resource_user_ids = employee.resource_calendar_id.resource_user_ids.ids
|
||||
is_resource_user = employee.id in resource_user_ids
|
||||
|
||||
existing_record = self.search([
|
||||
('employee_id', '=', employee.id),
|
||||
('vacation_date', '=', today),
|
||||
('vacation_state', '=', 'unconfirmed')
|
||||
('vacation_date', '=', today)
|
||||
], limit=1)
|
||||
|
||||
if not existing_record or not is_resource_user:
|
||||
|
||||
Reference in New Issue
Block a user