From fe446f6e441a16e328c40a073f11af2b916c06ad 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 16:10:29 +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 | 22 +++++++++---------- .../views/inherit_yuthon_property_views.xml | 2 +- .../wizard/property_reconciliation_wizard.py | 12 +++++++++- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index 155761170..aa9bef510 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -373,7 +373,7 @@ class PropertyBankStatements(models.Model): }) receivable_id.is_reconciliation = True - def _get_reconciliation_vals(self, record): + def _get_reconciliation_vals(self, record, contract_ids): if record.name: collection_type_map = { 'rent': '租金', @@ -390,7 +390,7 @@ class PropertyBankStatements(models.Model): total_rent_month = 0 # 应收租金 rent_ids = self.env['property.accounts.receivable'].search([ - ('contract_id', 'in', record.contract_ids.ids), + ('contract_id', 'in', contract_ids.ids), ('contract_id.lessor_id.referred', '=', self.your_own_unit), ('management_type_id.name', '=', '租金'), ('is_invalid', '=', False), @@ -399,7 +399,7 @@ class PropertyBankStatements(models.Model): # 更名费 rename_fee_ids = self.env['property.accounts.receivable'].search([ - ('contract_id', 'in', record.contract_ids.ids), + ('contract_id', 'in', contract_ids.ids), ('contract_id.lessor_id.referred', '=', self.your_own_unit), ('management_type_id.name', '=', '更名费'), ('is_invalid', '=', False), @@ -408,7 +408,7 @@ class PropertyBankStatements(models.Model): # 应收押金 deposit_ids = self.env['property.accounts.receivable'].search([ - ('contract_id', 'in', record.contract_ids.ids), + ('contract_id', 'in', contract_ids.ids), ('contract_id.lessor_id.referred', '=', self.your_own_unit), ('management_type_id.name', '=', '押金'), ('is_invalid', '=', False), @@ -416,7 +416,7 @@ class PropertyBankStatements(models.Model): ]) # 应收管理费 management_ids = self.env['property.accounts.receivable'].search([ - ('contract_id', 'in', record.contract_ids.ids), + ('contract_id', 'in', contract_ids.ids), ('contract_id.lessor_id.referred', '=', self.your_own_unit), ('management_type_id.name', '=', '管理费'), ('is_invalid', '=', False), @@ -424,7 +424,7 @@ class PropertyBankStatements(models.Model): ]) # 应收灯箱 lightbox_ids = self.env['property.accounts.receivable'].search([ - ('contract_id', 'in', record.contract_ids.ids), + ('contract_id', 'in', contract_ids.ids), ('contract_id.lessor_id.referred', '=', self.your_own_unit), ('management_type_id.name', '=', '灯箱'), ('is_invalid', '=', False), @@ -432,7 +432,7 @@ class PropertyBankStatements(models.Model): ]) # 应收管子间 guanzi_ids = self.env['property.accounts.receivable'].search([ - ('contract_id', 'in', record.contract_ids.ids), + ('contract_id', 'in', contract_ids.ids), ('contract_id.lessor_id.referred', '=', self.your_own_unit), ('management_type_id.name', '=', '管子间'), ('is_invalid', '=', False), @@ -441,7 +441,7 @@ class PropertyBankStatements(models.Model): # 应收水费 water_ids = self.env['property.accounts.receivable'].search([ - ('contract_id', 'in', record.contract_ids.ids), + ('contract_id', 'in', contract_ids.ids), ('contract_id.lessor_id.referred', '=', self.your_own_unit), ('management_type_id.name', '=', '水费'), ('is_invalid', '=', False), @@ -449,7 +449,7 @@ class PropertyBankStatements(models.Model): ]) # 应收电费 electricity_ids = self.env['property.accounts.receivable'].search([ - ('contract_id', 'in', record.contract_ids.ids), + ('contract_id', 'in', contract_ids.ids), ('contract_id.lessor_id.referred', '=', self.your_own_unit), ('management_type_id.name', '=', '电费'), ('is_invalid', '=', False), @@ -458,7 +458,7 @@ class PropertyBankStatements(models.Model): # 应收人工费/日光灯款/代垫用料费 fee_ids = self.env['property.accounts.receivable'].search([ - ('contract_id', 'in', record.contract_ids.ids), + ('contract_id', 'in', contract_ids.ids), ('contract_id.lessor_id.referred', '=', self.your_own_unit), ('management_type_id.name', '=', '人工费/日光灯款/代垫用料费'), ('is_invalid', '=', False), @@ -624,7 +624,7 @@ class PropertyBankStatements(models.Model): def button_reconciliation(self): for record in self: - all_vals, total_rent_month, used_type_names = self._get_reconciliation_vals(record) + all_vals, total_rent_month, used_type_names = self._get_reconciliation_vals(record, record.contract_ids) return self._get_context_and_action(record, all_vals, total_rent_month, used_type_names) def put_button(self): diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml index 0a34df1e7..78b703ca8 100644 --- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml +++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml @@ -643,7 +643,7 @@