From 2e5af8a16b68a5ef2f09aedf24851a050e543d4a 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: Fri, 28 Nov 2025 17:33:52 +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 | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index 7e72c780a..11725a4c9 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -256,28 +256,28 @@ class PropertyBankStatements(models.Model): def revocation(self): self.ensure_one() current_rec = self[0] - if current_rec.bank_state == 'reconciled': - domain = [ - ('your_own_unit', '=', current_rec.your_own_unit), - ('bank_state', '=', 'reconciled'), - ('name_account', '=', current_rec.name_account) - ] - same_group_records = self.env[self._name].search(domain) - if same_group_records: - # 按start_time倒序排序,找到最近的记录 - sorted_records = sorted( - same_group_records, - key=lambda r: r.start_time or '', - reverse=True - ) - latest_record = sorted_records[0] - # 检查当前记录是否是最近的一条 - if current_rec.id != latest_record.id: - raise UserError( - f"只能从最近的记录开始撤销!\n" - f"当前记录时间: {current_rec.start_time + timedelta(hours=8)}\n" - f"最近记录时间: {latest_record.start_time + timedelta(hours=8)}" - ) + # if current_rec.bank_state == 'reconciled': + # domain = [ + # ('your_own_unit', '=', current_rec.your_own_unit), + # ('bank_state', '=', 'reconciled'), + # ('name_account', '=', current_rec.name_account) + # ] + # same_group_records = self.env[self._name].search(domain) + # if same_group_records: + # # 按start_time倒序排序,找到最近的记录 + # sorted_records = sorted( + # same_group_records, + # key=lambda r: r.start_time or '', + # reverse=True + # ) + # latest_record = sorted_records[0] + # # 检查当前记录是否是最近的一条 + # if current_rec.id != latest_record.id: + # raise UserError( + # f"只能从最近的记录开始撤销!\n" + # f"当前记录时间: {current_rec.start_time + timedelta(hours=8)}\n" + # f"最近记录时间: {latest_record.start_time + timedelta(hours=8)}" + # ) for modify in self.receivable_modify_ids: if modify.is_write: