From 23f7cebe024059a5e08874c815b0257b2422066d Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Thu, 21 Aug 2025 20:10:02 +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 --- .../models/inherit_yuthon_property.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index 53ac7fee8..a8e4200ab 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -90,7 +90,14 @@ class PropertyBankStatements(models.Model): 'payout_date': None, }) return - to_delete = penalty_records.filtered(lambda r: not r.is_write) + + target_year = start_date.year + target_month = start_date.month + to_delete = penalty_records.filtered( + lambda r: not r.is_write + and fields.Date.from_string(r.due_date).year == target_year + and fields.Date.from_string(r.due_date).month == target_month + ) if to_delete: to_delete.unlink()