From fe412aad2bfabaee38c08998a4f750b40bebaeed Mon Sep 17 00:00:00 2001
From: zhou <123@>
Date: Mon, 30 Dec 2024 15:01:11 +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/yuthon_property.py | 4 ++--
.../models/yuthon_resource_mgmt_config.py | 17 ++++++++++++++++-
yuthon_property/security/ir.model.access.csv | 3 ++-
yuthon_property/views/menuitem.xml | 2 ++
yuthon_property/views/yuthon_property_views.xml | 6 +++---
.../views/yuthon_resource_mgmt_config_views.xml | 14 ++++++++++++++
.../wizard/yuthon_property_wizard.py | 9 ++++++---
.../views/property_lease_contract.xml | 1 +
8 files changed, 46 insertions(+), 10 deletions(-)
diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py
index dde9ba63d..01f214c31 100644
--- a/yuthon_property/models/yuthon_property.py
+++ b/yuthon_property/models/yuthon_property.py
@@ -65,7 +65,7 @@ class YuthonProperty(models.Model):
admin_id = fields.Many2one('res.users', string="管理员")
lessee_id = fields.Many2one('property.tenant.information', string='承租方')
title_address = fields.Many2one('yuthon.property.message', string="产权地址")
- yuthon_company = fields.Selection([('thtz', '天河投资'), ('thwg', '天河物管'), ('thlc', '天河粮储'), ('thtj', '天城投建'), ('housing', '房总')],string="所属公司")
+ company_id = fields.Many2one('yuthon.property.company', string="所属公司")
rental_address = fields.Text(string="出租地址")
tenure_type = fields.Selection([('self', '自有'), ('agency', '代管')], string='权属类型')
ame = fields.Char(string='标题')
@@ -328,7 +328,7 @@ class ManageInformationLine(models.Model):
rent_area = fields.Float(string="可租面积")
equity_area = fields.Float(string="产权面积")
admin_id = fields.Many2one('res.users', string="管理员")
- yuthon_company = fields.Selection([('thtz', '天河投资'), ('thwg', '天河物管'), ('thlc', '天河粮储'), ('thtj', '天城投建'), ('housing', '房总')], string="所属公司")
+ company_id = fields.Many2one('yuthon.property.company', string="所属公司")
start_time = fields.Date(string="生效日期", default=fields.Date.today)
end_date = fields.Date(string="失效日期")
diff --git a/yuthon_property/models/yuthon_resource_mgmt_config.py b/yuthon_property/models/yuthon_resource_mgmt_config.py
index 4c37677d0..2e105e757 100644
--- a/yuthon_property/models/yuthon_resource_mgmt_config.py
+++ b/yuthon_property/models/yuthon_resource_mgmt_config.py
@@ -43,6 +43,7 @@ class YuthonPropertySource(models.Model):
name = fields.Char(string="资产来源")
+
class YuthonOwnerMessage(models.Model):
_name = 'yuthon.owner.message'
_description = '权属人'
@@ -56,32 +57,46 @@ class YuthonRentalPurposes(models.Model):
name = fields.Char(string="出租用途")
+
class YuthonLiveRoom(models.Model):
_name = 'yuthon.live.room'
_description = '居住用房'
name = fields.Char(string="居住用房")
+
class YuthonElectricitySetting(models.Model):
_name = 'yuthon.electricity.setting'
_description = '电费标准配置'
name = fields.Char(string="电费标准")
+
class YuthonWaterSetting(models.Model):
_name = 'yuthon.water.setting'
_description = '水费标准配置'
name = fields.Char(string="水费标准")
+
class YuthonPropertySetting(models.Model):
_name = 'yuthon.property.setting'
_description = '物业费标准配置'
name = fields.Char(string="物业费标准")
+
class YuthonLotSetting(models.Model):
_name = 'yuthon.lot.setting'
_description = '地段配置'
- name = fields.Char(string="地段")
\ No newline at end of file
+ name = fields.Char(string="地段")
+
+
+class YuthonPropertyCompany(models.Model):
+ _name = 'yuthon.property.company'
+ _description = '物业公司配置'
+
+ name = fields.Char(string="物业公司")
+
+
diff --git a/yuthon_property/security/ir.model.access.csv b/yuthon_property/security/ir.model.access.csv
index 4f39b6307..4b59e43d5 100644
--- a/yuthon_property/security/ir.model.access.csv
+++ b/yuthon_property/security/ir.model.access.csv
@@ -53,4 +53,5 @@ access_yuthon_electricity_setting,yuthon_electricity_setting,model_yuthon_electr
access_yuthon_water_setting,yuthon_water_setting,model_yuthon_water_setting,base.group_user,1,1,1,1
access_manage_information_fee_line,manage.information.fee.line,model_manage_information_fee_line,base.group_user,1,1,1,1
access_yuthon_lot_setting,yuthon_lot_setting,model_yuthon_lot_setting,base.group_user,1,1,1,1
-access_yuthon_property_wizard,yuthon_property_wizard,model_yuthon_property_wizard,base.group_user,1,1,1,1
\ No newline at end of file
+access_yuthon_property_wizard,yuthon_property_wizard,model_yuthon_property_wizard,base.group_user,1,1,1,1
+access_yuthon_property_company,yuthon_property_company,model_yuthon_property_company,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 b802fda06..8c478bc3f 100644
--- a/yuthon_property/views/menuitem.xml
+++ b/yuthon_property/views/menuitem.xml
@@ -347,6 +347,8 @@
action="yuthon_live_room_action" sequence="40"/>
+
diff --git a/yuthon_property/views/yuthon_property_views.xml b/yuthon_property/views/yuthon_property_views.xml
index ce0060b5e..90d7a604b 100644
--- a/yuthon_property/views/yuthon_property_views.xml
+++ b/yuthon_property/views/yuthon_property_views.xml
@@ -57,7 +57,7 @@
-
+
@@ -121,7 +121,7 @@
-
+
@@ -227,7 +227,7 @@
-
+
diff --git a/yuthon_property/views/yuthon_resource_mgmt_config_views.xml b/yuthon_property/views/yuthon_resource_mgmt_config_views.xml
index 2bd48c30c..0d9f37d30 100644
--- a/yuthon_property/views/yuthon_resource_mgmt_config_views.xml
+++ b/yuthon_property/views/yuthon_resource_mgmt_config_views.xml
@@ -174,4 +174,18 @@
yuthon.lot.setting
tree
+
+ yuthon.property.company.tree
+ yuthon.property.company
+
+
+
+
+
+
+
+ 公司配置
+ yuthon.property.company
+ tree
+
diff --git a/yuthon_property/wizard/yuthon_property_wizard.py b/yuthon_property/wizard/yuthon_property_wizard.py
index a9fcc6768..a26e5a024 100644
--- a/yuthon_property/wizard/yuthon_property_wizard.py
+++ b/yuthon_property/wizard/yuthon_property_wizard.py
@@ -38,8 +38,11 @@ class YuthonPropertyWizard(models.Model):
owner_id = self.env['yuthon.owner.message'].create({
'name': row[13].value,
})
- yuthon_company_dict = {'天河投资': 'thtz', '天河物管': 'thwg', '天河粮储': 'thlc', '天投城建': 'thtj', '房总': 'housing', '': ''}
- yuthon_company = yuthon_company_dict.get(row[3].value, '')
+ company_id = self.env['yuthon.property.company'].search([('name', '=', row[3].value)])
+ if not company_id:
+ company_id = self.env['yuthon.property.company'].create({
+ 'name': row[3].value,
+ })
tenure_type_dict = {'自有':'self', '代管':'agency', '': ''}
tenure_type = tenure_type_dict.get(row[4].value, '')
admin_id = self.env['res.users'].search([('name', '=', row[5].value)])
@@ -88,7 +91,7 @@ class YuthonPropertyWizard(models.Model):
property_date = {
'name': property_name,
'referred_id': referred_id.id,
- 'yuthon_company': yuthon_company,
+ 'company_id': company_id.id,
'tenure_type': tenure_type,
'state': state,
'title_deed':title_certificate,
diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml
index f686eac9a..be8b961dc 100644
--- a/yuthon_property_approval/views/property_lease_contract.xml
+++ b/yuthon_property_approval/views/property_lease_contract.xml
@@ -35,6 +35,7 @@
+