- 休息日加班
for line in self.overtime_lines:
if line.overtime_type.sequence=='OTTYPE12958432':
result=True
break
#节假日field
the_dep = self.employee_id.department_id
dep_codes = [the_dep.code]
while the_dep.parent_department_id:
dep_codes.append(the_dep.parent_department_id.code)
the_dep = the_dep.parent_department_id
if 'DP058' in dep_codes:
is_DP058 = True
else:
is_DP058 = False
jiejiari=False
for line in self.overtime_lines:
if line.overtime_type.sequence=='OTTYPE68391546':
jiejiari=True
break
if jiejiari and is_DP058:
result = True
#节假日其他
the_dep = self.employee_id.department_id
dep_codes = [the_dep.code]
while the_dep.parent_department_id:
dep_codes.append(the_dep.parent_department_id.code)
the_dep = the_dep.parent_department_id
if 'DP058' in dep_codes:
is_DP058 = True
else:
is_DP058 = False
jiejiari=False
for line in self.overtime_lines:
if line.overtime_type.sequence=='OTTYPE68391546':
jiejiari=True
break
if jiejiari and not is_DP058:
result = True
#'L001','L006','L007','L012'假期小于24小时
type_code = self.holiday_type_id.code
leave_hours = self.leave_total if self.product_uom_id.name in ['Hour(s)','小时'] else self.leave_total*8
const_code = ['L001','L006','L007','L012']
if type_code in const_code and leave_hours<24:
result = True
#[('L001','L006','L007','L012'假期大于等于24小时)或(其他假期)]且是field部门
type_code = self.holiday_type_id.code
leave_hours = self.leave_total if self.product_uom_id.name in ['Hour(s)','小时'] else self.leave_total*8
const_code = ['L001','L006','L007','L012']
if (type_code in const_code and leave_hours>=24) or type_code not in const_code:
is_cond = True
the_dep = self.employee_id.department_id
dep_codes = [the_dep.code]
while the_dep.parent_department_id:
dep_codes.append(the_dep.parent_department_id.code)
the_dep = the_dep.parent_department_id
if 'DP058' in dep_codes:
is_DP058 = True
else:
is_DP058 = False
if is_cond and is_DP058
#[('L001','L006','L007','L012'假期大于等于24小时)或(其他假期)]且非field部门
type_code = self.holiday_type_id.code
leave_hours = self.leave_total if self.product_uom_id.name in ['Hour(s)','小时'] else self.leave_total*8
const_code = ['L001','L006','L007','L012']
if (type_code in const_code and leave_hours>=24) or type_code not in const_code:
is_cond = True
the_dep = self.employee_id.department_id
dep_codes = [the_dep.code]
while the_dep.parent_department_id:
dep_codes.append(the_dep.parent_department_id.code)
the_dep = the_dep.parent_department_id
if 'DP058' in dep_codes:
is_DP058 = True
else:
is_DP058 = False
if is_cond and not is_DP058