添加功能
This commit is contained in:
@@ -578,17 +578,28 @@ class HolidaysRequestBatch(models.Model):
|
||||
actual_vacation_report = vacation_report1
|
||||
if not actual_vacation_report:
|
||||
continue
|
||||
|
||||
existing_overtime_line = self.env['vacation.over.line'].search([
|
||||
('vacation_id', '=', actual_vacation_report.id),
|
||||
overtime_line_domain = [
|
||||
('employee_id', '=', employee_id),
|
||||
('workflow_record_id', '=', leave_data.get('workflow_id', False)),
|
||||
('update_type', '=', 'reduce'),
|
||||
('text', '=', f"请假审批"),
|
||||
('is_void', '=', False),
|
||||
('workday', '=', interval_hours),
|
||||
], limit=1)
|
||||
if not existing_overtime_line:
|
||||
]
|
||||
existing_line_in_vacation_report = False
|
||||
if vacation_report:
|
||||
existing_line_in_vacation_report = self.env['vacation.over.line'].search(
|
||||
[('vacation_id', '=', vacation_report.id)] + overtime_line_domain,
|
||||
limit=1
|
||||
)
|
||||
existing_line_in_vacation_report1 = False
|
||||
if vacation_report1:
|
||||
existing_line_in_vacation_report1 = self.env['vacation.over.line'].search(
|
||||
[('vacation_id', '=', vacation_report1.id)] + overtime_line_domain,
|
||||
limit=1
|
||||
)
|
||||
# 4. 只有当两个报表中都没有该记录时,才创建新记录
|
||||
if not existing_line_in_vacation_report and not existing_line_in_vacation_report1:
|
||||
self.env['vacation.over.line'].create({
|
||||
'vacation_id': actual_vacation_report.id,
|
||||
'employee_id': employee_id,
|
||||
@@ -604,6 +615,7 @@ class HolidaysRequestBatch(models.Model):
|
||||
})
|
||||
actual_vacation_report.update_line()
|
||||
actual_vacation_report._compute_working_overtime()
|
||||
|
||||
if self.env.user.company_id.name == '集团本部':
|
||||
domain = [
|
||||
('employee_id', '=', employee_id),
|
||||
@@ -696,20 +708,28 @@ class HolidaysRequestBatch(models.Model):
|
||||
if not actual_vacation_report:
|
||||
continue
|
||||
|
||||
# 3.3 检查当前月的记录是否已存在(避免重复)
|
||||
existing_annual_leave_line = self.env['vacation.leave.line'].search([
|
||||
('vacation_id', '=', actual_vacation_report.id),
|
||||
leave_line_domain = [
|
||||
('employee_id', '=', employee_id),
|
||||
('workflow_record_id', '=', leave_data.get('workflow_id', False)),
|
||||
('update_type', '=', 'reduce'),
|
||||
('allocation_type', '=', 'vacation'),
|
||||
('update_lines', '=', interval_hours),
|
||||
('text', '=', f"请假审批"),
|
||||
('is_void', '=', False),
|
||||
], limit=1)
|
||||
|
||||
# 不存在则创建当前月的年假扣减记录
|
||||
if not existing_annual_leave_line:
|
||||
('update_lines', '=', interval_hours),
|
||||
]
|
||||
existing_line_in_vacation_report = False
|
||||
if vacation_report:
|
||||
existing_line_in_vacation_report = self.env['vacation.leave.line'].search(
|
||||
[('vacation_id', '=', vacation_report.id)] + leave_line_domain,
|
||||
limit=1
|
||||
)
|
||||
existing_line_in_vacation_report1 = False
|
||||
if vacation_report1:
|
||||
existing_line_in_vacation_report1 = self.env['vacation.leave.line'].search(
|
||||
[('vacation_id', '=', vacation_report1.id)] + leave_line_domain,
|
||||
limit=1
|
||||
)
|
||||
if not existing_line_in_vacation_report and not existing_line_in_vacation_report1:
|
||||
self.env['vacation.leave.line'].create({
|
||||
'vacation_id': actual_vacation_report.id,
|
||||
'employee_id': employee_id,
|
||||
|
||||
@@ -204,7 +204,7 @@ class PropertyLeaseRenewal(models.Model):
|
||||
'remark': rec.total_remake,
|
||||
})
|
||||
if rec.receivables_ids:
|
||||
refund_lines = rec.receivables_ids.filtered(lambda l: l.refund_amount > 0 and management_type_id.name != '押金')
|
||||
refund_lines = rec.receivables_ids.filtered(lambda l: l.refund_amount > 0 and l.management_type_id.name != '押金')
|
||||
bills_line_list = []
|
||||
# 除押金的明细
|
||||
if refund_lines:
|
||||
|
||||
Reference in New Issue
Block a user