添加功能

This commit is contained in:
李鹏宇
2026-03-04 12:00:13 +08:00
parent 0cf3fccb6b
commit b9a5d03a04
+1 -2
View File
@@ -40,6 +40,7 @@ class CardApprovals(models.Model):
@api.depends('users_id')
def _compute_number_cards_replaced(self):
self.number_cards_replaced = 0
if self.attendance_id:
vacation_date = (self.attendance_id.current_data).replace(day=1)
vacation_report = self.env['yuthon.vacation.reports'].search([
@@ -49,8 +50,6 @@ class CardApprovals(models.Model):
if vacation_report:
vacation_report.vacation_date()
self.number_cards_replaced = vacation_report.number_card
else:
self.number_cards_replaced = 0
@api.constrains("users_id", "attendance_id")