From 1536ef2e299158bbceb8a90e61349248934f22fb 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: Fri, 19 Sep 2025 10:24:06 +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
---
yuthon_property/models/property_evaluation_plan.py | 9 +++++++++
yuthon_property/views/property_evaluation_plan_view.xml | 6 ++++++
.../models/property_transfer_approval.py | 1 +
.../views/property_transfer_views.xml | 3 ++-
4 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/yuthon_property/models/property_evaluation_plan.py b/yuthon_property/models/property_evaluation_plan.py
index fa1218948..b0e8b3e97 100644
--- a/yuthon_property/models/property_evaluation_plan.py
+++ b/yuthon_property/models/property_evaluation_plan.py
@@ -10,6 +10,8 @@ class PropertyEvaluationPlan(models.Model):
name = fields.Char(string='物业名称')
evaluation_area = fields.Float(string='评估面积(m²)')
property_ids = fields.Many2many('yuthon.property', string='物业')
+ company_id = fields.Many2one('yuthon.property.company', string='评估公司', compute='_compute_search', store=True)
+ admin_id = fields.Many2one('res.users', string="管理员", compute='_compute_search', store=True)
assessment_category = fields.Selection([('rent_money', '租金'), ('value', '价值')], string="评估类别", default='rent_money')
owner_id = fields.Many2one('yuthon.owner.message', string="权属人")
registered_id = fields.Many2one('yuthon.purpose.evidence', string='证载用途')
@@ -25,6 +27,13 @@ class PropertyEvaluationPlan(models.Model):
remake = fields.Text(string='备注')
property_state = fields.Selection([('to', '待审批'), ('done', '已审批')], string="状态", default='to')
+ @api.depends('property_ids')
+ def _compute_search(self):
+ for record in self:
+ if record.property_ids:
+ record.company_id = record.property_ids[0].company_id.id
+ record.admin_id = record.property_ids[0].admin_id.id
+
@api.depends('property_ids')
def compute_lease_form(self):
for record in self:
diff --git a/yuthon_property/views/property_evaluation_plan_view.xml b/yuthon_property/views/property_evaluation_plan_view.xml
index 9d9c0c2d8..f32b5f80d 100644
--- a/yuthon_property/views/property_evaluation_plan_view.xml
+++ b/yuthon_property/views/property_evaluation_plan_view.xml
@@ -36,6 +36,12 @@
+
+
+
+
+
+
diff --git a/yuthon_property_approval/models/property_transfer_approval.py b/yuthon_property_approval/models/property_transfer_approval.py
index f7a95c2d8..3e253aa91 100644
--- a/yuthon_property_approval/models/property_transfer_approval.py
+++ b/yuthon_property_approval/models/property_transfer_approval.py
@@ -14,6 +14,7 @@ class PropertyTransferApproval(models.Model):
default=lambda self: self.env['ir.sequence'].next_by_code('property_transfer_code'))
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
+ company_id = fields.Many2one(related='users_id.company_id', string="公司", store=True)
is_issues = fields.Boolean(string='是否上会')
issues_result = fields.Html(string="会议结果")
related_issues_id = fields.Many2one('issue.library', string="关联议题")
diff --git a/yuthon_property_approval/views/property_transfer_views.xml b/yuthon_property_approval/views/property_transfer_views.xml
index bbd976b84..9cf6a6846 100644
--- a/yuthon_property_approval/views/property_transfer_views.xml
+++ b/yuthon_property_approval/views/property_transfer_views.xml
@@ -48,7 +48,8 @@
-
+
+