diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py
index 2a67c61da..7e552271b 100644
--- a/yuthon_property/models/yuthon_property.py
+++ b/yuthon_property/models/yuthon_property.py
@@ -88,7 +88,7 @@ class YuthonProperty(models.Model):
'management_area':latest_record_id.management_area,
'rent_area': latest_record_id.rent_area,
'admin_id':latest_record_id.admin_id.id,
- 'company_id':latest_record_id.company_id,
+ 'company_id':latest_record_id.company_id.id,
})
@api.onchange('property_archives_id')
@@ -271,12 +271,6 @@ class YuthonProperty(models.Model):
"target": "new",
}
- # @api.onchange('property_meter_archives_id')
- # def _onchange_water_meter_ids(self):
- # for rec in self:
- # rec.property_meter_archives_id.write({'yuthon_property_id': rec.property_meter_archives_id.id})
-
-
class TitleInformationLine(models.Model):
_name = 'title.information.line'
_description = '产权信息明细行'
diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py
index 4ec8a1717..80b27975f 100644
--- a/yuthon_property_approval/models/property_lease_contract.py
+++ b/yuthon_property_approval/models/property_lease_contract.py
@@ -485,6 +485,12 @@ class PropertyLeaseContract(models.Model):
rec.electricity_fee_ids = electricity_list
rec.mange_fee_ids = fee_list
+ def trigger_lease_ids(self):
+ property_ids = self.env["property.lease.contract"].browse(self._context.get('active_ids', self._context.get('active_id')))
+ for record in property_ids:
+ company_id = record.lease_ids[0].address_id.company_id.id if record.lease_ids else ''
+ record.company_id = company_id
+
def action_yuthon_property_contract_wizard(self):
return {
"type": "ir.actions.act_window",
diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml
index 6921d7179..fedbcdc2d 100644
--- a/yuthon_property_approval/views/property_lease_contract.xml
+++ b/yuthon_property_approval/views/property_lease_contract.xml
@@ -261,4 +261,11 @@
code
action = model.action_relevance_property()
+
+ 更新出租方信息
+
+
+ code
+ action = model.trigger_lease_ids()
+
\ No newline at end of file