@@ -87,21 +87,22 @@ def check_employee_attendance_state(self):
8787 )
8888 )
8989
90- @api .model
91- def create (self , vals ):
92- res = super (HrTimesheetSheet , self ).create (vals )
93- attendances = self .env ["hr.attendance" ].search (
94- [
95- ("employee_id" , "=" , res .employee_id .id ),
96- ("sheet_id" , "=" , False ),
97- ("check_in" , ">=" , res .date_start ),
98- ("check_in" , "<=" , res .date_end ),
99- "|" ,
100- ("check_out" , "=" , False ),
101- "&" ,
102- ("check_out" , ">=" , res .date_start ),
103- ("check_out" , "<=" , res .date_end ),
104- ]
105- )
106- attendances ._compute_sheet_id ()
90+ @api .model_create_multi
91+ def create (self , vals_list ):
92+ res = super ().create (vals_list )
93+ for res in res :
94+ attendances = self .env ["hr.attendance" ].search (
95+ [
96+ ("employee_id" , "=" , res .employee_id .id ),
97+ ("sheet_id" , "=" , False ),
98+ ("check_in" , ">=" , res .date_start ),
99+ ("check_in" , "<=" , res .date_end ),
100+ "|" ,
101+ ("check_out" , "=" , False ),
102+ "&" ,
103+ ("check_out" , ">=" , res .date_start ),
104+ ("check_out" , "<=" , res .date_end ),
105+ ]
106+ )
107+ attendances ._compute_sheet_id ()
107108 return res
0 commit comments