From dfd6a23b29b65b00aeb29f705eebf74987be63b4 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 27 Aug 2025 11:11:56 +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_lease_contract.py | 8 +++++++- .../views/property_lease_contract.xml | 14 +++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index a102743e6..6ce4a1cca 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -1447,12 +1447,18 @@ class PropertyLeaseContract(models.Model): self.address_for_delivery = self.property_name self.use_address = self.property_name - @api.depends("admin_id") + @api.depends("lease_ids") def _compute_admin_id(self): for record in self: if record.lease_ids: record.admin_id = record.lease_ids[0].admin_line_id.id + @api.onchange("admin_id") + def _onchange_admin_id(self): + if self.admin_id: + self.users_id = self.admin_id.user_id.id + + def get_property_contract_time(self): records_only_in_tree1 = self.env['property.lease.contract'].search([ ('condition', 'not in', ['new', 'approval', 'cancel']) diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml index 4cf133fca..38ad204ef 100644 --- a/yuthon_property_approval/views/property_lease_contract.xml +++ b/yuthon_property_approval/views/property_lease_contract.xml @@ -918,13 +918,13 @@ code action = model.update_not_received() - - - - - - - + + 调换 + + + code + action = model.disposable_button() +