diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 532f44348..de1df46ab 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -304,26 +304,10 @@ class YuthonVacationReports(models.Model): over_ids = self.env["yuthon.vacation.reports"].browse( self._context.get('active_ids', self._context.get('active_id'))) for rec in over_ids: - inherit_lines = rec.meal_fee_ids.filtered(lambda l: l.text == '上月额度继承') - if not inherit_lines: - continue + inherit_lines = rec.overtime_ids.filtered(lambda l: l.text == '上月额度继承') + if inherit_lines: + rec.is_initial_number = True - current_date = rec.vacation_date - if current_date.month == 1: - last_month = current_date.replace(year=current_date.year - 1, month=12, day=1) - else: - last_month = current_date.replace(month=current_date.month - 1, day=1) - last_month_report = self.env["yuthon.vacation.reports"].search([ - ('employee_id', '=', rec.employee_id.id), - ('vacation_date', '=', last_month) - ], limit=1) - last_remain = last_month_report.remain_missed_meals - if not last_remain: - inherit_lines.sudo().unlink() - else: - inherit_lines.write({ - 'update_lines': last_remain, - }) def all_update_line(self): records = self.env["yuthon.vacation.reports"].browse( @@ -2265,7 +2249,7 @@ class VacationOverline(models.Model): rec.duration = 0 if rec.is_initial_number: - rec.duration = rec.workday or 0 + rec.duration = rec.workday + rec.public_holidays rec.overtime_name = '2025年12月结余初始数' rec.start_time = datetime(2025, 12, 1, 1, 0, 0) rec.end_time = datetime(2025, 12, 1, 9, 0, 0) diff --git a/yuthon_property_approval/models/property_management.py b/yuthon_property_approval/models/property_management.py index 7f9121e52..030206dcb 100644 --- a/yuthon_property_approval/models/property_management.py +++ b/yuthon_property_approval/models/property_management.py @@ -119,7 +119,6 @@ class PropertyManagement(models.Model): ]) lease_contract_ids.lessor_id = record.company_id.id lease_contract_ids.is_lessor = True - lease_contract_ids.version = new_version lease_contract_ids.users_id = record.user_id if record_id: continue @@ -144,6 +143,7 @@ class PropertyManagement(models.Model): 'start_date': lease_contract_ids.actual_start_time, 'end_date': new_end_date }) + lease_contract_ids.version = new_version existing_info = self.env['manage.information.line'].search([ ('yuthon_property_id', '=', target_property_id), diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml index d6ee3b296..544474f9a 100644 --- a/yuthon_property_approval/views/property_lease_contract.xml +++ b/yuthon_property_approval/views/property_lease_contract.xml @@ -152,7 +152,7 @@ - +