for record in self:
holidays = self.env['hr.holiday.inquiry'].search([('employee_id','=',record.employee_id.id),('holiday_type_id.code','=','L004')])
amount = 0
for holiday in holidays:
if holiday.start_date <= record.x_yjlzrq <= holiday.end_date:
amount += holiday.balances
record['x_wxfdnjts'] = amount
for record in self:
holidays = self.env ['hr.holiday.inquiry'] .search( [('employee_id','=',record.employee_id.id),('holiday_type_id.code','=','L004')] )
amount = 0
for holiday in holidays:
if holiday.start_date <= record.x_yjlzrq <= holiday.end_date:
amount += holiday.balances
record ['x_wxfdnjts'] = amount