添加功能

This commit is contained in:
李鹏宇
2026-01-31 20:47:43 +08:00
parent 822315e45e
commit 90ebd0ccbc
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -548,7 +548,6 @@ class HolidaysRequestBatch(models.Model):
'text': f"请假审批"
})
('start_time', '>=', datetime(2025, 12, 1)),
remaining_deduct = deduct_days
vacation_report.vacation_report += deduct_days
# 优先扣减上年剩余(补休)
@@ -565,6 +564,7 @@ class HolidaysRequestBatch(models.Model):
vacation_report.this_year1 -= remaining_deduct
else:
vacation_report.this_year1 = 0.0
vacation_report._compute_working_overtime()
domain = [
('employee_id', '=', self.users_id.employee_ids.id),
@@ -542,12 +542,12 @@ class YuthonVacationReports(models.Model):
for record in records:
record._compute_display_date()
def update_state(self):
def update_working_overtime(self):
records = self.env["yuthon.vacation.reports"].browse(
self._context.get('active_ids', self._context.get('active_id', self.ids))
)
for record in records:
record.vacation_state = 'not_sent'
record._compute_working_overtime()
@api.depends('vacation_date')
def _compute_display_date(self):
@@ -784,12 +784,12 @@
<field name="state">code</field>
<field name="code">action = model.update_vacation()</field>
</record>
<record id="all_update_state" model="ir.actions.server">
<field name="name">还原状态</field>
<record id="all_update_working_overtime" model="ir.actions.server">
<field name="name">一次性</field>
<field name="model_id" ref="yuthon_hr_attendance.model_yuthon_vacation_reports"/>
<field name="binding_model_id" ref="yuthon_hr_attendance.model_yuthon_vacation_reports"/>
<field name="state">code</field>
<field name="code">action = model.update_state()</field>
<field name="code">action = model.update_working_overtime()</field>
</record>
<record id="all_update_data" model="ir.actions.server">
<field name="name">更新报表</field>