添加功能

This commit is contained in:
李鹏宇
2026-04-16 18:50:22 +08:00
parent 64f48c6f71
commit 9333c12391
@@ -63,10 +63,11 @@ class PropertyApproval(models.Model):
'approval_date': fields.Datetime.now(),
})
# 审批触发按钮
def button_property_approval(self):
for massage_id in self.property_massage_ids:
property_message_id = self.env['yuthon.property.message'].search([('name', '=', massage_id.property_address)])
property_message_id = self.env['yuthon.property.message'].search([
('name', '=', massage_id.property_address)
], limit=1)
if not property_message_id:
property_message_id = self.env['yuthon.property.message'].create({
'name': massage_id.property_address,
@@ -75,14 +76,26 @@ class PropertyApproval(models.Model):
'title_certificate': massage_id.title_number,
'registered_id': massage_id.registered_id.id,
})
property_id = self.env['yuthon.property'].create({
'name': massage_id.property_address,
'is_confirm_authorization': massage_id.is_affirmation,
})
self.env['title.information.line'].create({
'yuthon_property_id': property_id.id,
'property_message_id': property_message_id.id,
})
property_id = self.env['yuthon.property'].search([
('name', '=', massage_id.property_address)
], limit=1)
if not property_id:
property_id = self.env['yuthon.property'].create({
'name': massage_id.property_address,
'is_new': True,
'is_confirm_authorization': massage_id.is_affirmation,
})
line_exists = self.env['title.information.line'].search([
('yuthon_property_id', '=', property_id.id),
('property_message_id', '=', property_message_id.id),
], limit=1)
if not line_exists:
self.env['title.information.line'].create({
'yuthon_property_id': property_id.id,
'property_message_id': property_message_id.id,
})
class PropertyApprovalLine(models.Model):
_name = 'property.approval.line'