diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index 3a42fb4f2..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.onchange('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 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 @@ - - + +