From 9342191f36c4bf95d63146b2370cc4d9827fa192 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 26 Mar 2025 15:07:55 +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 | 2 +- .../models/yuthon_resource_mgmt_config.py | 8 ++++ yuthon_property/security/ir.model.access.csv | 3 +- yuthon_property/views/menuitem.xml | 2 + .../views/yuthon_property_views.xml | 3 +- .../yuthon_resource_mgmt_config_views.xml | 15 ++++++++ .../wizard/yuthon_property_wizard.py | 10 +++-- .../models/property_evaluate_application.py | 19 +++++++--- .../models/property_merge_approval.py | 4 +- .../models/property_split_approval.py | 4 +- .../property_evaluate_application_views.xml | 4 +- .../views/property_merge_approval_views.xml | 4 +- .../views/property_split_approval_views.xml | 6 +-- yuthon_work_brand/views/hr_menus.xml | 38 +++++++++---------- 14 files changed, 79 insertions(+), 43 deletions(-) diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py index 15166182a..1ffccf926 100644 --- a/yuthon_property/models/yuthon_property.py +++ b/yuthon_property/models/yuthon_property.py @@ -28,7 +28,7 @@ class YuthonProperty(models.Model): current_rent = fields.Float(string="现租金") is_done_split = fields.Boolean(string="已拆分") is_done_merge = fields.Boolean(string="已合并") - property_floor = fields.Char(string="楼层") + property_floor_id = fields.Many2one('property.floor.setting', string="楼层") property_orientation = fields.Selection([('north', '东'), ('south', '南'), ('east', '西'), ('west', '北')], string="朝向") street = fields.Char(string="街道") diff --git a/yuthon_property/models/yuthon_resource_mgmt_config.py b/yuthon_property/models/yuthon_resource_mgmt_config.py index ed23c01f9..4691e7421 100644 --- a/yuthon_property/models/yuthon_resource_mgmt_config.py +++ b/yuthon_property/models/yuthon_resource_mgmt_config.py @@ -210,3 +210,11 @@ class MajorEventSetting(models.Model): inspector_html = fields.Html(string="内容") documents_ids = fields.Many2many('ir.attachment', string="附件") start_date = fields.Date(string="生效日期", default=fields.Date.today()) + + +class PropertyFloorSetting(models.Model): + _name = 'property.floor.setting' + _description = '楼层配置' + + name = fields.Char(string="名称") + premises_id = fields.Many2one('yuthon.premises.setting', 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 3acb3e977..7bef271b7 100644 --- a/yuthon_property/security/ir.model.access.csv +++ b/yuthon_property/security/ir.model.access.csv @@ -82,4 +82,5 @@ access_yuthon_reference_conditions,yuthon_reference_conditions,model_yuthon_refe access_rent_free_line,rent_free_line,model_rent_free_line,base.group_user,1,1,1,1 access_feature_setting,feature_setting,model_feature_setting,base.group_user,1,1,1,1 access_major_event_setting,major_event_setting,model_major_event_setting,base.group_user,1,1,1,1 -access_yuthon_major_event_line,yuthon_major_event_line,model_yuthon_major_event_line,base.group_user,1,1,1,1 \ No newline at end of file +access_yuthon_major_event_line,yuthon_major_event_line,model_yuthon_major_event_line,base.group_user,1,1,1,1 +access_property_floor_setting,property_floor_setting,model_property_floor_setting,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 f9354b9e2..91f061d16 100644 --- a/yuthon_property/views/menuitem.xml +++ b/yuthon_property/views/menuitem.xml @@ -340,6 +340,8 @@ action="view_yuthon_property_produce_action" sequence="80"/> + - + @@ -284,6 +284,7 @@ + diff --git a/yuthon_property/views/yuthon_resource_mgmt_config_views.xml b/yuthon_property/views/yuthon_resource_mgmt_config_views.xml index 2eedd0c44..14ac94540 100644 --- a/yuthon_property/views/yuthon_resource_mgmt_config_views.xml +++ b/yuthon_property/views/yuthon_resource_mgmt_config_views.xml @@ -368,4 +368,19 @@ major.event.setting tree + + property.floor.setting.tree + property.floor.setting + + + + + + + + + 楼层配置 + property.floor.setting + tree + diff --git a/yuthon_property/wizard/yuthon_property_wizard.py b/yuthon_property/wizard/yuthon_property_wizard.py index f75b6eb41..e6e6cdcd7 100644 --- a/yuthon_property/wizard/yuthon_property_wizard.py +++ b/yuthon_property/wizard/yuthon_property_wizard.py @@ -185,17 +185,19 @@ class YuthonPropertyWizard(models.Model): def yuthon_premises_id(self,row): property_id = self.env['yuthon.property'].search([('name', '=', row[0].value)]) premises_id = self.env['yuthon.premises.setting'].search([('name', '=', row[1].value)]) - property_floor = row[2].value - units = row[3].value + property_floor_id = self.env['property.floor.setting'].search([('name', '=', row[2].value)]) if not premises_id: premises_id = self.env['yuthon.premises.setting'].create({ 'name': row[1].value, }) + if not property_floor_id: + property_floor_id = self.env['property.floor.setting'].create({ + 'name': row[2].value, + }) if property_id: property_id.write({ 'premises_id': premises_id.id, - 'property_floor': property_floor, - 'units': units, + 'property_floor_id': property_floor_id.id, }) diff --git a/yuthon_property_approval/models/property_evaluate_application.py b/yuthon_property_approval/models/property_evaluate_application.py index f67d965cf..4492babfe 100644 --- a/yuthon_property_approval/models/property_evaluate_application.py +++ b/yuthon_property_approval/models/property_evaluate_application.py @@ -78,6 +78,7 @@ class EvaluateApplicationLine(models.Model): property_message_id = fields.Many2one('property.evaluate.application', string='关联评估申请') premises_id = fields.Many2one('yuthon.premises.setting', string="楼盘") + property_id = fields.Many2one('yuthon.property', string="物业") owner_id = fields.Many2one('yuthon.owner.message', string="权属人") assessment_category = fields.Selection([('rent_money', '租金'), ('value', '价值')], string="评估类别") registered_id = fields.Many2one('yuthon.purpose.evidence', string='证载用途') @@ -94,8 +95,7 @@ class EvaluateApplicationLine(models.Model): current_status = fields.Date(string='现状(合同到期日)') evaluation_area = fields.Float(string='评估面积(m²)') remarks = fields.Text(string='备注') - property_floor = fields.Text(string="楼层") - units = fields.Text(string="单元") + property_floor_id = fields.Many2one('property.floor.setting', string="楼层") last_hand_rent_price = fields.Float(string='上一手历史租金单价(元/m²•月)') gov_rent_price = fields.Float(string='政府租金参考价') evaluation_rent_price = fields.Float(string='评估散租单价(元/m²•月)') @@ -104,12 +104,10 @@ class EvaluateApplicationLine(models.Model): evaluation_whole_rent_total = fields.Float(string='评估总价(元•月,整租)') def application_detail(self): - domain = [] + domain = [('state', '=', 'to')] domain.append(('premises_id', '=', self.premises_id.id)) if self.property_floor: domain.append(('property_floor', '=', self.property_floor)) - if self.units: - domain.append(('units', '=', self.units)) return { "name": _("物业"), "type": "ir.actions.act_window", @@ -117,4 +115,13 @@ class EvaluateApplicationLine(models.Model): "res_model": "yuthon.property", "target": "new", # 使动作以弹窗形式打开 "domain": domain, - } \ No newline at end of file + } + + def set_property_state_to_ing(self): + domain = [('state', '=', 'to')] + domain.append(('premises_id', '=', self.premises_id.id)) + if self.property_floor: + domain.append(('property_floor', '=', self.property_floor)) + property_ids = self.env['yuthon.property'].search(domain) + for property in property_ids: + property.write({'state': 'ing'}) \ No newline at end of file diff --git a/yuthon_property_approval/models/property_merge_approval.py b/yuthon_property_approval/models/property_merge_approval.py index 0e5b046fe..b32e3dd6d 100644 --- a/yuthon_property_approval/models/property_merge_approval.py +++ b/yuthon_property_approval/models/property_merge_approval.py @@ -18,7 +18,7 @@ class PropertyMergeApproval(models.Model): # 合并后 property_name = fields.Char(string='物业名称') merge_units = fields.Char(string='单元') - merge_property_floor = fields.Char(string='楼层') + merge_property_floor_id = fields.Many2one('property.floor.setting', string='楼层') merge_asset_type_id = fields.Many2one('yuthon.resource.type', string='资产类型') merge_building_area = fields.Float(string='建筑面积') merge_rent_area = fields.Float(string='可租面积') @@ -91,7 +91,7 @@ class PropertyMergeApprovalLine(models.Model): property_merge_approval_id = fields.Many2one('property.merge.approval', string='关联物业合并审批') property_id = fields.Many2one('yuthon.property', string='物业名称') units = fields.Char(related='property_id.units', string='单元') - property_floor = fields.Char(related='property_id.property_floor', string='楼层') + property_floor_id = fields.Many2one(related='property_id.property_floor_id', string='楼层') asset_type_id = fields.Many2one(related='property_id.asset_type_id', string='资产类型') building_area = fields.Float(related='property_id.building_area', string='建筑面积') rent_area = fields.Float(related='property_id.rent_area', string='可租面积') diff --git a/yuthon_property_approval/models/property_split_approval.py b/yuthon_property_approval/models/property_split_approval.py index 84ee176b4..3d137ddeb 100644 --- a/yuthon_property_approval/models/property_split_approval.py +++ b/yuthon_property_approval/models/property_split_approval.py @@ -12,7 +12,7 @@ class PropertySplitApproval(models.Model): department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门") property_id = fields.Many2one('yuthon.property', string='物业名称') units = fields.Char(related='property_id.units', string='单元') - property_floor = fields.Char(related='property_id.property_floor', string='楼层') + property_floor_id = fields.Many2one(related='property_id.property_floor_id', string='楼层') asset_type_id = fields.Many2one(related='property_id.asset_type_id', string='资产类型') building_area = fields.Float(related='property_id.building_area', string='建筑面积') rent_area = fields.Float(related='property_id.rent_area', string='可租面积') @@ -71,7 +71,7 @@ class PropertySplitApprovalLine(models.Model): property_split_approval_id = fields.Many2one('property.split.approval', string='关联物业拆分审批') split_property = fields.Char(string='物业名称') split_units = fields.Char(string='单元') - split_property_floor = fields.Char(string='楼层') + split_property_floor_id = fields.Many2one('property.floor.setting', string='楼层') split_asset_type_id = fields.Many2one('yuthon.resource.type', string='资产类型') split_building_area = fields.Float(string='建筑面积') split_rent_area = fields.Float(string='可租面积') diff --git a/yuthon_property_approval/views/property_evaluate_application_views.xml b/yuthon_property_approval/views/property_evaluate_application_views.xml index bca386eae..4155c3ea1 100644 --- a/yuthon_property_approval/views/property_evaluate_application_views.xml +++ b/yuthon_property_approval/views/property_evaluate_application_views.xml @@ -58,8 +58,8 @@ - - + + diff --git a/yuthon_property_approval/views/property_merge_approval_views.xml b/yuthon_property_approval/views/property_merge_approval_views.xml index 662c16eab..e434f8727 100644 --- a/yuthon_property_approval/views/property_merge_approval_views.xml +++ b/yuthon_property_approval/views/property_merge_approval_views.xml @@ -64,7 +64,7 @@ - + @@ -76,7 +76,7 @@ - + diff --git a/yuthon_property_approval/views/property_split_approval_views.xml b/yuthon_property_approval/views/property_split_approval_views.xml index e1ed987f2..2a50da2e9 100644 --- a/yuthon_property_approval/views/property_split_approval_views.xml +++ b/yuthon_property_approval/views/property_split_approval_views.xml @@ -8,7 +8,7 @@ - + @@ -60,7 +60,7 @@ - +