From e12ecea828825f80e7fd5ad8ac527b7cb09862fa 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, 11 May 2026 11:24:19 +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/property_bank_statements.py | 8 ++++ .../models/property_lease_contract.py | 2 +- .../views/property_lease_contract.xml | 44 ++++++++++--------- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/yuthon_property/models/property_bank_statements.py b/yuthon_property/models/property_bank_statements.py index c88708386..7e63004c2 100644 --- a/yuthon_property/models/property_bank_statements.py +++ b/yuthon_property/models/property_bank_statements.py @@ -226,6 +226,7 @@ class ReceivableModifyLine(models.Model): no_amount = fields.Float(related='bank_id.no_amount', string='未对', store=False) bank_state = fields.Selection(related='bank_id.bank_state', string='状态', store=False) receivable_id = fields.Many2one('property.accounts.receivable', string='合同编号') + contract_id = fields.Many2one('property.lease.contract', string='关联租赁合同', compute='_compute_contract_id') management_type_id = fields.Many2one('yuthon.management.type', related='receivable_id.management_type_id', string='应收类型', store=True) due_date = fields.Date(related='receivable_id.due_date', string='应收开始', store=False) due_date_end = fields.Date(related='receivable_id.due_date_end', string='应收结束', store=False) @@ -240,6 +241,13 @@ class ReceivableModifyLine(models.Model): # search='_search_lessee_id', # ) + @api.depends('receivable_id') + def _compute_contract_id(self): + for rec in self: + rec.contract_id = False + if rec.receivable_id: + rec.contract_id = rec.receivable_id.contract_id + @api.depends('receivable_id') def _compute_lessee_id_company(self): for rec in self: diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index 6ae1e33a6..4531646d0 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -240,7 +240,7 @@ class PropertyLeaseContract(models.Model): electricity_fee_ids = fields.One2many('property.electric.fee.line', 'contract_id', string="物业电表明细行") other_ids = fields.One2many('property.other.fee.line', 'other_id', string="其他费用明细行") lease_bank_ids = fields.One2many('property.bank.line', 'contract_id', string="承租方账户明细行") - bank_statements_ids = fields.One2many('property.bank.statements', 'contract_id', string="银行流水明细行") + bank_statements_ids = fields.One2many('receivable.modify.line', 'contract_id', string="银行流水明细行") contact_state = fields.Selection([('to', '待执行' ), ('ing', '执行中'), ('terminate', '中止'), ('complete', '完成'), ('early_termination', '提前终止'), ('settle', '结清')], string='合同管理状态', default='to') # 附件 license_ids = fields.Many2many('ir.attachment', diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml index 1d597f282..0f0ba3c14 100644 --- a/yuthon_property_approval/views/property_lease_contract.xml +++ b/yuthon_property_approval/views/property_lease_contract.xml @@ -336,19 +336,21 @@ - + - - - - - - - - + + + + + + + - + + + + @@ -844,19 +846,21 @@ - + - - - - - - - - + + + + + + + - + + + +