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()
+