From ed27274d6d6f6ef8aa4f39e078ddef4efb49a359 Mon Sep 17 00:00:00 2001
From: zhouzhou <123@qq.com>
Date: Fri, 1 Nov 2024 11:51:32 +0800
Subject: [PATCH 1/4] =?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
---
.../views/yuthon_job_lv_views.xml | 66 +------------------
yuthon_property/models/property_assess.py | 3 +
yuthon_property/models/yuthon_property.py | 56 +++++++++++-----
.../models/yuthon_property_evaluated.py | 29 +++++++-
.../models/yuthon_resource_mgmt_config.py | 5 ++
yuthon_property/security/ir.model.access.csv | 4 +-
yuthon_property/views/menuitem.xml | 3 +
.../views/yuthon_property_evaluated_views.xml | 48 +++++++-------
.../yuthon_resource_mgmt_config_views.xml | 15 ++++-
.../models/property_evaluate_application.py | 59 ++++++++++++++---
.../models/property_record.py | 12 ++--
.../security/ir.model.access.csv | 4 +-
.../property_evaluate_application_views.xml | 16 ++---
.../views/property_record_views.xml | 8 ++-
14 files changed, 194 insertions(+), 134 deletions(-)
diff --git a/yuthon_hr_employee/views/yuthon_job_lv_views.xml b/yuthon_hr_employee/views/yuthon_job_lv_views.xml
index 3c86d403f..f9eaa9398 100644
--- a/yuthon_hr_employee/views/yuthon_job_lv_views.xml
+++ b/yuthon_hr_employee/views/yuthon_job_lv_views.xml
@@ -42,37 +42,6 @@
tree
{'search_default_group_company': True, 'search_default_group_lv': True}
-
-
- yuthon.job.lv.tree
- yuthon.job.lv
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 职级管理
- yuthon.job.lv
- tree
- [('yuthon_company', '=', 'tz')]
-
- {'search_default_group_company': True, 'search_default_group_lv': True}
-
yuthon.job.lv.tree
@@ -102,37 +71,6 @@
{'search_default_group_company': True, 'search_default_group_lv': True}
-
-
-
- yuthon.job.lv.tree
- yuthon.job.lv
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 职级管理
- yuthon.job.lv
- tree
- [('yuthon_company', '=', 'thlc')]
-
- {'search_default_group_company': True, 'search_default_group_lv': True}
\ No newline at end of file
diff --git a/yuthon_property/models/property_assess.py b/yuthon_property/models/property_assess.py
index c170e0e0e..d64805cf3 100644
--- a/yuthon_property/models/property_assess.py
+++ b/yuthon_property/models/property_assess.py
@@ -10,3 +10,6 @@ class PropertyAssess(models.Model):
class PropertyAssessLine(models.Model):
_name = 'property.assess.line'
+class PropertyType(models.Model):
+ _name = 'property.type'
+
diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py
index a8e397f46..a3df3cb3b 100644
--- a/yuthon_property/models/yuthon_property.py
+++ b/yuthon_property/models/yuthon_property.py
@@ -1,6 +1,7 @@
from odoo import models, fields, api
from odoo.exceptions import UserError, ValidationError
+
class YuthonProperty(models.Model):
_name = 'yuthon.property'
_description = '物业管理'
@@ -32,17 +33,18 @@ class YuthonProperty(models.Model):
pooled_area = fields.Float(string="公摊面积")
rentable_area = fields.Float(string="可租面积")
state = fields.Selection([('to', '待评估'), ('done', '已评估'), ('ing', '评估中'),
- ('ing_handover', '移交中') ,('done_handover', '已移交'),
- ('filing', '评估备案'), ('net', '挂网'), ('signing', '签约中'),
- ('leased', '已出租'),('idle', '闲置')],string='状态', default='to')
+ ('ing_handover', '移交中'), ('done_handover', '已移交'),
+ ('filing', '备案中'), ('net', '挂网'), ('signing', '签约中'),
+ ('signed', '已备案'), ('leased', '已出租'), ('idle', '闲置')], string='状态', default='to')
is_meter = fields.Boolean(string="是否有水表")
is_electricity_meter = fields.Boolean(string="是否有电表")
- company_page = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储'), ('tj','天河投建')], string="所属公司")
+ company_page = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储'), ('tj', '天河投建')],
+ string="所属公司")
admin_id = fields.Many2one('res.users', string="管理员")
purpose_id = fields.Many2one('yuthon.resource.purpose', string="资产用途")
mgmt_type_id = fields.Many2one('yuthon.resource.management.type', string="管理类型")
is_confirm_authorization = fields.Boolean(string="是否确权")
- owner_id = fields.Many2one('res.users', string="权属人")
+ owner_id = fields.Many2one('yuthon.owner.message', string="权属人")
property_card = fields.Html(string="产权证")
life_timer = fields.Datetime(string="使用时间")
property_use_time = fields.Selection([('a', '70年'), ('b', '40年')], string="使用年限")
@@ -71,15 +73,18 @@ class YuthonProperty(models.Model):
water_meter_ids = fields.One2many('yuthon.property.water', 'yuthon_property_id', string='水表列表')
energy_meter_ids = fields.One2many('yuthon.property.energy', 'yuthon_property_id', string='电表列表')
title_information_ids = fields.One2many('title.information.line', 'yuthon_property_id', string='关联产权信息明细行')
- manage_information_ids = fields.One2many('manage.information.line', 'yuthon_property_id', string='关联管理信息明细行')
- disassembly_information_ids = fields.One2many('disassembly.information.line', 'yuthon_property_id', string='关联拆合信息明细行')
+ manage_information_ids = fields.One2many('manage.information.line', 'yuthon_property_id',
+ string='关联管理信息明细行')
+ disassembly_information_ids = fields.One2many('disassembly.information.line', 'yuthon_property_id',
+ string='关联拆合信息明细行')
+
@api.onchange('building_area')
def _onchange_building_area(self):
for rec in self:
rec.management_area = rec.building_area
rec.rentable_area = rec.building_area
- #待评估物业相关信息
+ # 待评估物业相关信息
unit_price = fields.Float(string='单价')
current_status = fields.Date(string='现状(合同到期日)')
registered_use = fields.Char(string='证载用途')
@@ -96,9 +101,7 @@ class YuthonProperty(models.Model):
evaluation_whole_rent_price = fields.Float(string='评估整租单价(元/m² •月)')
evaluation_whole_rent_total = fields.Float(string='评估总价(元•月,整租)')
- assessment_category = fields.Char(string='评估类别')
- property_message_id = fields.Many2one('property.evaluate.application', string='关联物业评估申请')
- # yuthon_property_evaluated_id = fields.Many2one('yuthon.property.evaluated', string='关联评估备案表')
+
def put_change_title(self):
pass
@@ -107,7 +110,8 @@ class YuthonProperty(models.Model):
pass
def put_property_handover(self):
- property_ids = self.env["yuthon.property"].browse(self._context.get('active_ids', self._context.get('active_id')))
+ property_ids = self.env["yuthon.property"].browse(
+ self._context.get('active_ids', self._context.get('active_id')))
form_id = self.env.ref('yuthon_property_approval.view_property_handover_form').id
property_list = []
for record in property_ids:
@@ -121,9 +125,10 @@ class YuthonProperty(models.Model):
'type': 'ir.actions.act_window',
'views': [(form_id, 'form')],
"context": {
- 'default_property_handover_ids':property_list
+ 'default_property_handover_ids': property_list
}
}
+
def put_assessment_approval(self):
property_ids = self.env["yuthon.property"].browse(
self._context.get('active_ids', self._context.get('active_id')))
@@ -135,10 +140,23 @@ class YuthonProperty(models.Model):
if i.state != 'to':
raise UserError("当前状态不允许提交")
form_id = self.env.ref('yuthon_property_approval.property_evaluate_application_form').id
+ property_list = []
if not property_ids:
property_ids = self
for i in property_ids:
i.write({'state': 'ing'})
+ for record in property_ids:
+ property_list.append([0, 0, {'name': record.name,
+ 'evaluation_area': record.evaluation_area,
+ 'registered_use':record.registered_use,
+ 'owner_id': record.owner_id.id,
+ 'purpose_id': record.purpose_id.id,
+ 'current_status': record.current_status,
+ 'last_hand_rent_price': record.unit_price,
+ 'rental_conditions': record.rental_conditions,
+ 'state':record.state,
+ 'remarks': record.remarks}])
+
return {
'name': '提交物业评估',
'view_mode': 'form',
@@ -146,7 +164,7 @@ class YuthonProperty(models.Model):
'type': 'ir.actions.act_window',
'views': [(form_id, 'form')],
"context": {
- 'default_yuthon_property_ids': [(6, 0, property_ids.ids)]
+ 'default_evaluate_application_ids': property_list
}
}
@@ -170,6 +188,7 @@ class YuthonPropertyWater(models.Model):
for rec in self:
rec.property_meter_water_id.write({'yuthon_property_id': rec.property_meter_water_id.id})
+
class YuthonPropertyEnergy(models.Model):
_name = 'yuthon.property.energy'
_description = '电表'
@@ -190,7 +209,6 @@ class YuthonPropertyEnergy(models.Model):
rec.property_meter_archives_id.write({'yuthon_property_id': rec.property_meter_archives_id.id})
-
class TitleInformationLine(models.Model):
_name = 'title.information.line'
_description = '产权信息明细行'
@@ -201,11 +219,12 @@ class TitleInformationLine(models.Model):
management_area = fields.Float(string="管理面积")
building_area = fields.Float(string="建筑面积")
rent_area = fields.Float(string="可租面积")
- owner = fields.Char(string="权属人")
+ owner = fields.Many2one('yuthon.owner.message',string="权属人")
title_certificate = fields.Char(string="产权证号")
start_time = fields.Date(string="生效日期")
end_date = fields.Date(string="失效日期")
+
class ManageInformationLine(models.Model):
_name = 'manage.information.line'
_description = '管理信息明细行'
@@ -219,12 +238,13 @@ class ManageInformationLine(models.Model):
start_time = fields.Date(string="生效日期")
end_date = fields.Date(string="失效日期")
+
class DisassemblyInformationLine(models.Model):
_name = 'disassembly.information.line'
_description = '拆合信息明细行'
yuthon_property_id = fields.Many2one('yuthon.property', string="关联物业信息")
- property_name = fields.Char(string="物业名称") #逻辑没搞清,暂时先放这里
+ property_name = fields.Char(string="物业名称") # 逻辑没搞清,暂时先放这里
rent_area = fields.Float(string="可租面积")
start_time = fields.Date(string="生效日期")
- end_date = fields.Date(string="失效日期")
\ No newline at end of file
+ end_date = fields.Date(string="失效日期")
diff --git a/yuthon_property/models/yuthon_property_evaluated.py b/yuthon_property/models/yuthon_property_evaluated.py
index 1f304a91e..9b82cc944 100644
--- a/yuthon_property/models/yuthon_property_evaluated.py
+++ b/yuthon_property/models/yuthon_property_evaluated.py
@@ -12,4 +12,31 @@ class YuthonPropertyEvaluated(models.Model):
base_date = fields.Date(string="基准日")
expert_review_time = fields.Date(string="专家评审时间")
notice_documents_ids = fields.Many2many('ir.attachment', string='议题附件')
- # yuthon_property_evaluation_ids = fields.One2many('yuthon.', 'yuthon_property_evaluated_id', string='物业信息明细行')
\ No newline at end of file
+ evaluate_application_ids = fields.One2many('evaluated.application.line', 'yuthon_property_evaluated_id', string='关联物业信息明细行')
+
+
+class EvaluatedApplicationLine(models.Model):
+ _name = 'evaluated.application.line'
+ _description = '物业信息明细行(已评估)'
+
+ yuthon_property_evaluated_id = fields.Many2one('yuthon.property.evaluated', string='关联评估备案表(已评估)')
+ name = fields.Char(string='评估资产')
+ owner_id = fields.Many2one('yuthon.owner.message', string="权属人")
+ assessment_category = fields.Selection([('rent_money', '租金'), ('value', '价值')], string="评估类别")
+ registered_use = fields.Char(string='证载用途')
+ purpose_id = fields.Many2one('yuthon.resource.purpose', string="资产用途")
+ rental_conditions = fields.Text(string='出租条件')
+ current_status = fields.Date(string='现状(合同到期日)')
+ evaluation_area = fields.Float(string='评估面积(m²)')
+ remarks = fields.Text(string='备注')
+ last_hand_rent_price = fields.Float(string='上一手历史租金单价(元/m²•月)')
+ gov_rent_price = fields.Float(string='政府租金参考价')
+ evaluation_rent_price = fields.Float(string='评估散租单价(元/m²•月)')
+ evaluation_rent_total = fields.Float(string='评估总价(元•月,散租)')
+ evaluation_whole_rent_price = fields.Float(string='评估整租单价(元/m² •月)')
+ evaluation_whole_rent_total = fields.Float(string='评估总价(元•月,整租)')
+ state = fields.Selection([('to', '待评估'), ('done', '已评估'), ('ing', '评估中'),
+ ('ing_handover', '移交中'), ('done_handover', '已移交'),
+ ('filing', '备案中'), ('net', '挂网'), ('signing', '签约中'),
+ ('signed', '已备案'), ('leased', '已出租'), ('idle', '闲置')], string='状态',
+ default='to')
\ No newline at end of file
diff --git a/yuthon_property/models/yuthon_resource_mgmt_config.py b/yuthon_property/models/yuthon_resource_mgmt_config.py
index 87cea83d1..14cd739dc 100644
--- a/yuthon_property/models/yuthon_resource_mgmt_config.py
+++ b/yuthon_property/models/yuthon_resource_mgmt_config.py
@@ -43,3 +43,8 @@ class YuthonPropertySource(models.Model):
name = fields.Char(string="资产来源")
+class YuthonOwnerMessage(models.Model):
+ _name = 'yuthon.owner.message'
+ _description = '权属人'
+
+ name = fields.Char(string="名称")
\ No newline at end of file
diff --git a/yuthon_property/security/ir.model.access.csv b/yuthon_property/security/ir.model.access.csv
index 70f19eff9..8eddf53d4 100644
--- a/yuthon_property/security/ir.model.access.csv
+++ b/yuthon_property/security/ir.model.access.csv
@@ -24,4 +24,6 @@ access_property_prospective_customers,property_prospective_customers,model_prope
access_title_information_line,title_information_line,model_title_information_line,base.group_user,1,1,1,1
access_manage_information_line,manage_information_line,model_manage_information_line,base.group_user,1,1,1,1
access_disassembly_information_line,disassembly_information_line,model_disassembly_information_line,base.group_user,1,1,1,1
-access_yuthon_property_source,yuthon_property_source,model_yuthon_property_source,base.group_user,1,1,1,1
\ No newline at end of file
+access_yuthon_property_source,yuthon_property_source,model_yuthon_property_source,base.group_user,1,1,1,1
+access_yuthon_owner_message,yuthon_owner_message,model_yuthon_owner_message,base.group_user,1,1,1,1
+access_evaluated_application_line,evaluated_application_line,model_evaluated_application_line,base.group_user,1,1,1,1
\ No newline at end of file
diff --git a/yuthon_property/views/menuitem.xml b/yuthon_property/views/menuitem.xml
index 8a53c399e..8f60634a6 100644
--- a/yuthon_property/views/menuitem.xml
+++ b/yuthon_property/views/menuitem.xml
@@ -280,6 +280,8 @@
+
+