From 7f4d99cdef0b1999d841f3ef18cb5cb997cbf80f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Thu, 13 Nov 2025 17:03:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_hr_attendance/models/card_approval.py | 1 - .../models/property_accounts_receivable.py | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/yuthon_hr_attendance/models/card_approval.py b/yuthon_hr_attendance/models/card_approval.py index 18e4f5700..5f628d663 100644 --- a/yuthon_hr_attendance/models/card_approval.py +++ b/yuthon_hr_attendance/models/card_approval.py @@ -109,7 +109,6 @@ class CardApprovals(models.Model): workflow_id = self.env['soong.workflow.record'].search([('code', '=', self.code)], limit=1).id self.attendance_id.sudo().write({ - 'is_approval': True, 'is_abnormal': False, 'is_no_card': False, 'is_late_card': False, diff --git a/yuthon_property/models/property_accounts_receivable.py b/yuthon_property/models/property_accounts_receivable.py index a7f4682bd..a46ab1b8e 100644 --- a/yuthon_property/models/property_accounts_receivable.py +++ b/yuthon_property/models/property_accounts_receivable.py @@ -77,16 +77,21 @@ class PropertyAccountsReceivable(models.Model): ('due_date', '=', penalty_start_date), ('management_type_id.name', '=', '违约金'), ], limit=1) - - penalty_lines = self.env['receivable.modify.line'].search([ - ('receivable_id', '=', penalty_receivable_id.id), - ('reconciliation_date', '!=', False), - ('is_penalty', '=', True) - ], order='reconciliation_date asc') + if penalty_receivable_id: + penalty_lines = self.env['receivable.modify.line'].search([ + ('receivable_id', '=', penalty_receivable_id.id), + ('reconciliation_date', '!=', False), + ('is_penalty', '=', True) + ], order='reconciliation_date asc') + else: + penalty_lines = self.env['receivable.modify.line'] rent_pay_count = len(modify_lines.filtered(lambda l: not l.is_penalty)) # 租金支付次数 penalty_pay_count = len(penalty_lines.filtered(lambda l: l.is_penalty)) # 违约金支付次数 - record.number_of_payments = rent_pay_count + penalty_pay_count + if record.management_type_id.name == '押金': + record.number_of_payments = rent_pay_count + else: + record.number_of_payments = rent_pay_count + penalty_pay_count @api.depends('original_amount', 'delivered1', 'discount_amount')