From 3839944660395e68249c650d04a650ced1cb30bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Fri, 24 Apr 2026 18:17:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E7=A5=A8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_property/wizard/batch_invoice_export_wizard.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/yuthon_property/wizard/batch_invoice_export_wizard.py b/yuthon_property/wizard/batch_invoice_export_wizard.py index a11045647..fc1b7cc6f 100644 --- a/yuthon_property/wizard/batch_invoice_export_wizard.py +++ b/yuthon_property/wizard/batch_invoice_export_wizard.py @@ -66,11 +66,13 @@ class BatchInvoiceExportWizard(models.TransientModel): sheet['B2'] = f'{title_year}年{title_month}月' - # 统计最常见公司(用于C2) + # 统计最常见公司(用于C2,取合同出租方公司简称) company_list = [] for record in receivable_records: - if record.contract_id and record.contract_id.company_id: - company_list.append(record.contract_id.company_id.name) + if record.contract_id and record.contract_id.lessor_id: + referred = record.contract_id.lessor_id.referred + if referred: + company_list.append(referred) if company_list: from collections import Counter