diff --git a/yuthon_contract/models/inherit_hr_contract.py b/yuthon_contract/models/inherit_hr_contract.py index d107bfa85..835ccc7f4 100644 --- a/yuthon_contract/models/inherit_hr_contract.py +++ b/yuthon_contract/models/inherit_hr_contract.py @@ -481,6 +481,19 @@ class HrContract(models.Model): }) contracts._sync_party_company() + # 创建合同时自动初始化异动信息明细行 + for contract in contracts: + if not contract.change_ids: + self.env['hr.contract.change.line'].create({ + 'contract_id': contract.id, + 'department_id': contract.department_id.id, + 'job_id': contract.job_id.id, + 'structure_type_id': contract.structure_type_id.id, + 'salary_group_id': contract.salary_group_id.id, + 'change_start_date': contract.date_start, + 'change_end_date': contract.date_end, + }) + return contracts diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index c0db69c17..3a1842fc8 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -2756,6 +2756,7 @@ class YuthonVacationReports(models.Model): pending = self.env['soong.workflow.record'].sudo().search_count([ ('users_ids', 'in', user.id), ('approvals_group_id.name', '=', '考勤'), + ('reclaim_state', '=', False), ('approve_state', '=', 'pending'), ('workflow_happen_date', '>=', month_start), ('workflow_happen_date', '<=', month_end), diff --git a/yuthon_property_approval/wizard/property_rental_wizard.py b/yuthon_property_approval/wizard/property_rental_wizard.py index b1a6c4d68..9bfa5c01a 100644 --- a/yuthon_property_approval/wizard/property_rental_wizard.py +++ b/yuthon_property_approval/wizard/property_rental_wizard.py @@ -125,11 +125,9 @@ class PropertyRentalWizard(models.Model): ] # 判断是否有已生成押金 first_day_of_month = due_date.replace(day=1) - last_day_of_month = first_day_of_month + relativedelta(months=1) - timedelta(days=1) existing_receivable = self.env['property.accounts.receivable'].search([ ('lessee_id', '=', record.lessee_id.id), - ('due_date', '>=', first_day_of_month), - ('due_date', '<=', last_day_of_month), + ('due_date', '=', first_day_of_month), ('management_type_id.name', '=', '押金'), ('company_id', '=', record.lessor_id.id), ('contract_id.contract_code', '=', record.contract_code),