From 5a423b8c710d2b11205191128bdcf96851cd5c23 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?=
<9664676+pengyuthon@user.noreply.gitee.com>
Date: Tue, 22 Sep 2026 19:13:52 +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/inherit_yuthon_property.py | 21 +++++++++++++++++++
.../views/inherit_yuthon_property_views.xml | 12 +++++++++++
2 files changed, 33 insertions(+)
diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py
index a14da64c9..5d6625a2b 100644
--- a/yuthon_property_approval/models/inherit_yuthon_property.py
+++ b/yuthon_property_approval/models/inherit_yuthon_property.py
@@ -682,6 +682,16 @@ class PropertyAccountsReceivable(models.Model):
charging_range = fields.Text(string="收费区间")
precinct_id = fields.Many2one('yuthon.precinct.message', string="所属片区", compute='_compute_precinct_id', store=True)
+ # 核对人:应收账单创建时自动记录当前登录人
+ verifier_id = fields.Many2one('res.users', string="核对人", default=lambda self: self.env.user)
+
+ @api.model_create_multi
+ def create(self, vals_list):
+ """创建应收账单时,核对人自动填当前登录人(未显式指定时)"""
+ for vals in vals_list:
+ if not vals.get('verifier_id'):
+ vals['verifier_id'] = self.env.user.id
+ return super().create(vals_list)
@api.depends('contract_id', 'contract_id.lease_ids', 'contract_id.lease_ids.address_id',
'contract_id.lease_ids.address_id.manage_information_ids', 'due_date')
@@ -1338,6 +1348,8 @@ class PropertyRentList(models.Model):
property_address = fields.Text(string="物业信息", compute='get_property_address')
contract_sort = fields.Selection([('property', '物业'), ('guanggao', '广告位'),('parking', '停车场'), ('guanzi', '管子间'), ('room', '机房'), ('base_station','基站'), ('other', '其他')], related='contract_id.contract_sort', string="资产类型", index=True)
company_id = fields.Many2one('yuthon.property.company', string="出租方公司", store=True, compute='_compute_company_id')
+ # 核对人:推送生成应收时写入当前登录人
+ verifier_id = fields.Many2one('res.users', string="核对人")
@api.depends("property_id", "due_date")
def _compute_admin_id(self):
@@ -1467,6 +1479,7 @@ class PropertyRentList(models.Model):
'management_type_id': management_type.id,
})
rec.is_push = True
+ rec.verifier_id = self.env.user.id # 核对人 = 当前登录人
accounts_id._compute_precinct_id()
accounts_id._compute_lessee_id()
self.reconcile_with_bank_statements(rec)
@@ -1517,6 +1530,8 @@ class PropertyDepositList(models.Model):
original_amount = fields.Float(string="金额")
tenure_type = fields.Selection(related='contract_id.tenure_type', string="权属类型", store=True)
company_id = fields.Many2one(related='contract_id.lessor_id', string="出租方公司", store=True)
+ # 核对人:推送生成应收时写入当前登录人
+ verifier_id = fields.Many2one('res.users', string="核对人")
def push_deposit(self):
for rec in self:
@@ -1535,6 +1550,7 @@ class PropertyDepositList(models.Model):
})
accounts_id._compute_lessee_id()
rec.is_push = True
+ rec.verifier_id = self.env.user.id # 核对人 = 当前登录人
def batch_push_deposit(self):
archives_ids = self.env["property.deposit.list"].browse(
@@ -1550,6 +1566,7 @@ class PropertyDepositList(models.Model):
'management_type_id': management_type_id.id,
})
rec.is_push = True
+ rec.verifier_id = self.env.user.id # 核对人 = 当前登录人
def delete_duplicate_deposit(self):
"""删除重复押金:同一合同 + 同一保证金类型只保留最早一条,删除其余"""
@@ -1587,6 +1604,8 @@ class PropertyManagementList(models.Model):
property_name = fields.Text(string='物业', compute="_compute_property_name")
company_id = fields.Many2one(related='contract_id.lessor_id', string="出租方公司", store=True)
tenure_type = fields.Selection(related='contract_id.tenure_type', string="权属类型", store=True)
+ # 核对人:推送生成应收时写入当前登录人
+ verifier_id = fields.Many2one('res.users', string="核对人")
@api.depends('contract_id')
def _compute_property_name(self):
@@ -1658,6 +1677,7 @@ class PropertyManagementList(models.Model):
})
accounts_id._compute_lessee_id()
rec.is_push = True
+ rec.verifier_id = self.env.user.id # 核对人 = 当前登录人
def batch_push_management(self):
archives_ids = self.env["property.management.list"].browse(
@@ -1672,6 +1692,7 @@ class PropertyManagementList(models.Model):
'management_type_id': management_type_id.id,
})
rec.is_push = True
+ rec.verifier_id = self.env.user.id # 核对人 = 当前登录人
# 电费
class PropertyTariffList(models.Model):
diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml
index edfe4700f..a463ad9cc 100644
--- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml
+++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml
@@ -154,6 +154,10 @@
+
+
+
+
@@ -190,6 +194,10 @@
+
+
+
+
@@ -351,6 +359,10 @@
+
+
+
+