diff --git a/yuthon_hr_attendance/models/overtime_approval.py b/yuthon_hr_attendance/models/overtime_approval.py index fcb0e20b7..ae6ebfe64 100644 --- a/yuthon_hr_attendance/models/overtime_approval.py +++ b/yuthon_hr_attendance/models/overtime_approval.py @@ -235,7 +235,7 @@ class OvertimeApprovals(models.Model): raise UserError("开始时间不能晚于结束时间") start_date = fields.Datetime.from_string(record.start_time) end_date = fields.Datetime.from_string(record.end_time) - public_holidays = self.env['resource.calendar.leaves'].search([]) + public_holidays = self.env['resource.calendar.leaves'].search([("calendar_id", "=", "行政考勤工作日")]) for holiday in public_holidays: holiday_start = fields.Datetime.from_string(holiday.date_from) holiday_end = fields.Datetime.from_string(holiday.date_to) diff --git a/yuthon_hr_attendance/views/overtime_approval.xml b/yuthon_hr_attendance/views/overtime_approval.xml index f51ed381f..ef46fa500 100644 --- a/yuthon_hr_attendance/views/overtime_approval.xml +++ b/yuthon_hr_attendance/views/overtime_approval.xml @@ -62,6 +62,7 @@ + @@ -76,7 +77,6 @@ - diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index 8f08f3402..9872a9ec7 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -623,19 +623,20 @@ class PropertyRentList(models.Model): else: due_date_end = fields.Date.to_string(theoretical_end) - # 创建应收记录 - self.env['property.accounts.receivable'].create({ - 'contract_id': contract.id if contract else None, - 'property_id': rec.property_id.id, - 'lessee_id': contract.lessee_id.id if contract and contract.lessee_id else None, - 'original_amount': rec.original_amount, - 'due_date': due_date, - 'due_date_end': due_date_end, - 'create_time': datetime.now(), - 'management_type_id': management_type.id, - }) - rec.is_push = True - self.reconcile_with_bank_statements(rec) + # 创建应收记录 + self.env['property.accounts.receivable'].create({ + 'contract_id': contract.id if contract else None, + 'property_id': rec.property_id.id, + 'lessee_id': contract.lessee_id.id if contract and contract.lessee_id else None, + 'original_amount': rec.original_amount, + 'due_date': due_date, + 'due_date_end': due_date_end, + 'create_time': datetime.now(), + 'management_type_id': management_type.id, + }) + + rec.is_push = True + self.reconcile_with_bank_statements(rec) def reconcile_with_bank_statements(self, rec): bank_accounts = self.env['property.bank.line'].search([