From 2a8f60949e003286e6560a99af2e3408216fcf54 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 30 Jul 2025 17:13:01 +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 --- .../views/maintenance_equipment_views.xml | 3 ++- .../views/property_bank_statements_views.xml | 1 + .../wizard/choose_property_wizard.py | 13 +++++++------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/yuthon_maintain/views/maintenance_equipment_views.xml b/yuthon_maintain/views/maintenance_equipment_views.xml index 01b80e09b..bd2c45d25 100644 --- a/yuthon_maintain/views/maintenance_equipment_views.xml +++ b/yuthon_maintain/views/maintenance_equipment_views.xml @@ -95,9 +95,10 @@ 1 - 员工 + 1 + diff --git a/yuthon_property/views/property_bank_statements_views.xml b/yuthon_property/views/property_bank_statements_views.xml index 8cfc43984..910bf8460 100644 --- a/yuthon_property/views/property_bank_statements_views.xml +++ b/yuthon_property/views/property_bank_statements_views.xml @@ -84,6 +84,7 @@ 对账 property.bank.statements tree,search + [('is_company', '=', True)] [('bank_state', '=', 'not_reconciled')] diff --git a/yuthon_property_approval/wizard/choose_property_wizard.py b/yuthon_property_approval/wizard/choose_property_wizard.py index 1b41a5cb8..3d824d344 100644 --- a/yuthon_property_approval/wizard/choose_property_wizard.py +++ b/yuthon_property_approval/wizard/choose_property_wizard.py @@ -9,7 +9,6 @@ class ChoosePropertyWizard(models.Model): def confirm(self): rec = self.lease_contract_id - self.lease_contract_id.lease_ids.unlink() lease_name = [] lease_ids_to_add = [] fee_list = [] @@ -39,11 +38,13 @@ class ChoosePropertyWizard(models.Model): rec.admin_id = admin_id rec.company_id = company_id rec.precinct_id = precinct_id - - self.lease_contract_id.lease_ids = lease_ids_to_add - self.lease_contract_id.write({'name': ','.join(lease_name), - 'use_address': ','.join(lease_name), - 'address_for_delivery': ','.join(lease_name), + existing_names = [lease.address_id.name for lease in self.lease_contract_id.lease_ids if lease.address_id] + all_names = list(set(existing_names + lease_name)) # 去重 + existing_lease_ids = [(4, lease.id) for lease in self.lease_contract_id.lease_ids] + self.lease_contract_id.lease_ids = existing_lease_ids + lease_ids_to_add + self.lease_contract_id.write({'name': ','.join(all_names), + 'use_address': ','.join(all_names), + 'address_for_delivery': ','.join(all_names), 'total_area': sum([lease.property_area for lease in rec.lease_ids])})