From df07a8cb94e61d50119628cd6713aafbdaef109e Mon Sep 17 00:00:00 2001
From: zhou <123@>
Date: Sat, 4 Jan 2025 15:04:45 +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 | 21 +++++++++----------
.../views/property_lease_contract.xml | 11 ++++++++--
2 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py
index 65f2d12c1..60055f928 100644
--- a/yuthon_property_approval/models/property_lease_contract.py
+++ b/yuthon_property_approval/models/property_lease_contract.py
@@ -643,17 +643,16 @@ class PropertyLeaseContract(models.Model):
'rent_list_ids': rent_list,
'management_list_ids':management_list,})
-
-
-
- def action_copy_record(self):
- for record in self:
- vals = record.read()[0]
- vals['state'] = 'new'
- vals.pop('id', None)
- new_record = self.create(vals)
-
-
+ def disposable_button(self):
+ property_ids = self.env["property.lease.contract"].browse(
+ self._context.get('active_ids', self._context.get('active_id')))
+ for record in property_ids:
+ admin_id = record.admin_id
+ user_id = record.users_id
+ if admin_id and user_id:
+ record.write({
+ 'admin_id': user_id.id,
+ 'users_id': admin_id.id,})
class PropertyLeaseContractLine(models.Model):
_name = 'property.lease.contract.line'
diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml
index 84c46db64..67f9da858 100644
--- a/yuthon_property_approval/views/property_lease_contract.xml
+++ b/yuthon_property_approval/views/property_lease_contract.xml
@@ -55,7 +55,7 @@
-
+
@@ -181,7 +181,7 @@
-
+
@@ -311,4 +311,11 @@
code
action = model.action_use_address()
+
+ 调换
+
+
+ code
+ action = model.disposable_button()
+
\ No newline at end of file