From 476cb6fd5b786dd3b7af7959eefdf49051ce4c43 Mon Sep 17 00:00:00 2001 From: pengyuthon Date: Sun, 19 Oct 2025 00:19:04 +0800 Subject: [PATCH 1/2] 1 --- yuthon_property_approval/models/inherit_yuthon_property.py | 2 +- .../views/inherit_yuthon_property_views.xml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index 3a42fb4f2..b31b33966 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -51,7 +51,7 @@ class MeterArchivesLine(models.Model): contract_name = fields.Char(string='合同名称') lessee_name = fields.Char(string='承租方名称') - @api.onchange('contract_id', 'lessee_id') + @api.depends('contract_id', 'lessee_id') def onchange_contract_lessee(self): if self.contract_id: self.contract_name = self.contract_id.name diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml index 2d2776706..2d02e60ec 100644 --- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml +++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml @@ -27,6 +27,8 @@ + + @@ -55,8 +57,8 @@ - - + + From b04afe25185550fa385d68087c46f81d5a345ac5 Mon Sep 17 00:00:00 2001 From: pengyuthon Date: Sun, 19 Oct 2025 00:20:09 +0800 Subject: [PATCH 2/2] 1 --- yuthon_property_approval/models/inherit_yuthon_property.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index b31b33966..a16704d53 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -51,7 +51,7 @@ class MeterArchivesLine(models.Model): contract_name = fields.Char(string='合同名称') lessee_name = fields.Char(string='承租方名称') - @api.depends('contract_id', 'lessee_id') + @api.depends('archives_id', 'contract_id', 'lessee_id') def onchange_contract_lessee(self): if self.contract_id: self.contract_name = self.contract_id.name @@ -79,7 +79,7 @@ class MeterWaterLine(models.Model): contract_name = fields.Char(string='合同名称') lessee_name = fields.Char(string='承租方名称') - @api.onchange('contract_id', 'lessee_id') + @api.depends('water_id', 'contract_id', 'lessee_id') def onchange_contract_lessee(self): if self.contract_id: self.contract_name = self.contract_id.name