From d00e324d271b7a379597b1a4c86d4e8d65e5c7d6 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: Mon, 24 Nov 2025 15:18:24 +0800 Subject: [PATCH 1/2] =?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 | 8 ++++---- .../wizard/binding_information_wizard.py | 16 +++++++--------- .../wizard/property_reconciliation_wizard.py | 2 +- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index e943f9861..6275fbef3 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -506,8 +506,8 @@ class PropertyBankStatements(models.Model): current_sequence += 10 - if vals_list and type_name: - used_type_names.add(type_name) + if vals_list and type_name: + used_type_names.add(type_name) return vals_list, current_sequence @@ -599,8 +599,8 @@ class PropertyBankStatements(models.Model): ]) if statements: unreconciled[account] = len(statements) - if unreconciled: - raise UserError("存在未对账的历史流水,请优先处理:") + # if unreconciled: + # raise UserError("存在未对账的历史流水,请优先处理:") def button_reconciliation(self): for record in self: diff --git a/yuthon_property_approval/wizard/binding_information_wizard.py b/yuthon_property_approval/wizard/binding_information_wizard.py index d2dd739cb..cb7f1f532 100644 --- a/yuthon_property_approval/wizard/binding_information_wizard.py +++ b/yuthon_property_approval/wizard/binding_information_wizard.py @@ -95,14 +95,6 @@ class BindingInformationWizard(models.Model): 'user': self.bank_id.name_account, 'name': self.bank_id.bank_branch, }) - - # 更新其他记录 - bank_ids = self.env['property.bank.statements'].search([('name', '=', self.bank_id.name), - ('your_own_unit', '=', self.bank_id.your_own_unit), - ('bank_state', '=', 'not_reconciled'), - ]) - for bank_id in bank_ids: - bank_id._compute_property_employee_id() else: if self.contract_ids: first_contract = self.contract_ids[0] @@ -127,4 +119,10 @@ class BindingInformationWizard(models.Model): self.bank_id.write({ 'name': name, }) - self.bank_id._compute_property_employee_id() \ No newline at end of file + + bank_ids = self.env['property.bank.statements'].search([('name', '=', self.bank_id.name), + ('your_own_unit', '=', self.bank_id.your_own_unit), + ('bank_state', '=', 'not_reconciled'), + ]) + for bank_id in bank_ids: + bank_id._compute_property_employee_id() \ No newline at end of file diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index dd74dce87..b69d2f341 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -438,7 +438,7 @@ class PropertyReconciliationWizard(models.Model): yes_amount = 0 for line in rec.reconciliation_line_ids: # 跳过金额为0的行 - if (line.amount == 0 and line.collection_type != 'penalty') or \ + if (round(line.rent or 0, 2) == 0 and line.collection_type != 'penalty') or \ (line.contract_id and line.contract_id.is_contract): continue if line.amount != line.rent: From 60d25b0deb64f9d3982e81008413b3dae1d91e10 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: Mon, 24 Nov 2025 15:22:00 +0800 Subject: [PATCH 2/2] =?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 --- .../wizard/binding_information_wizard.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/yuthon_property_approval/wizard/binding_information_wizard.py b/yuthon_property_approval/wizard/binding_information_wizard.py index cb7f1f532..58e1f66cd 100644 --- a/yuthon_property_approval/wizard/binding_information_wizard.py +++ b/yuthon_property_approval/wizard/binding_information_wizard.py @@ -71,15 +71,10 @@ class BindingInformationWizard(models.Model): if old_lines: old_lines.unlink() for contract_id in latest_contract_ids: - existing_line = self.env['property.tenant.line'].sudo().search([ - ('tenant_id', '=', bank_account.tenant_id.id), - ('lease_contract_id', '=', contract_id.id), - ], limit=1) - if not existing_line: - self.env['property.tenant.line'].sudo().create({ - 'tenant_id': bank_account.tenant_id.id, - 'lease_contract_id': contract_id.id, - }) + self.env['property.tenant.line'].sudo().create({ + 'tenant_id': bank_account.tenant_id.id, + 'lease_contract_id': contract_id.id, + }) if self.contract_ids: for new_contract in self.contract_ids: