From e0baa8ef03ec9d6c992cf8bcfc2da33d6df3dcaf Mon Sep 17 00:00:00 2001 From: zhouzhou <123@qq.com> Date: Mon, 4 Nov 2024 11:53:19 +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 | 53 ++- yuthon_property/views/menuitem.xml | 29 +- .../views/yuthon_property_views.xml | 386 +++++++++++++++++- yuthon_property_approval/__manifest__.py | 2 + .../data/sale_renting_code_data.xml | 10 + yuthon_property_approval/models/__init__.py | 4 +- .../models/property_merge_approval.py | 71 ++++ .../models/property_split_approval.py | 69 ++++ .../security/ir.model.access.csv | 6 +- .../views/property_menu_all.xml | 13 +- .../views/property_merge_approval_views.xml | 78 ++++ .../views/property_split_approval_views.xml | 80 ++++ 12 files changed, 777 insertions(+), 24 deletions(-) create mode 100644 yuthon_property_approval/models/property_merge_approval.py create mode 100644 yuthon_property_approval/models/property_split_approval.py create mode 100644 yuthon_property_approval/views/property_merge_approval_views.xml create mode 100644 yuthon_property_approval/views/property_split_approval_views.xml diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py index 095447071..0a5f7ec51 100644 --- a/yuthon_property/models/yuthon_property.py +++ b/yuthon_property/models/yuthon_property.py @@ -24,6 +24,10 @@ class YuthonProperty(models.Model): vr_link = fields.Char(string="VR链接") notice_documents_ids = fields.Many2many('ir.attachment', string='议题附件') current_rent = fields.Float(string="现租金") + is_merge = fields.Boolean(string="是否可合并") + is_split = fields.Boolean(string="是否可拆分") + is_done_split = fields.Boolean(string="已拆分") + is_done_merge = fields.Boolean(string="已合并") abbreviation = fields.Char(string="简称") property_floor = fields.Integer(string="楼层") @@ -39,7 +43,7 @@ class YuthonProperty(models.Model): ('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', '天河投建')], + yuthon_company = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储'), ('tj', '天河投建')], string="所属公司") admin_id = fields.Many2one('res.users', string="管理员") purpose_id = fields.Many2one('yuthon.resource.purpose', string="资产用途") @@ -67,7 +71,6 @@ class YuthonProperty(models.Model): manage_standard = fields.Char(string="物业管理费标准") title_address = fields.Char(string="产权地址") rental_address = fields.Char(string="出租地址") - ame = fields.Char(string='标题') decoration_type = fields.Selection([('blank', '毛坯'), ('hardcover', '精装'), ('brands', '简装'), ('rsz', '豪装')], string="装修类型") @@ -77,7 +80,8 @@ class YuthonProperty(models.Model): manage_information_ids = fields.One2many('manage.information.line', 'yuthon_property_id', string='关联管理信息明细行') disassembly_information_ids = fields.One2many('disassembly.information.line', 'yuthon_property_id', - string='关联拆合信息明细行') + string='关联拆分信息明细行') + property_merge_approval_id = fields.Many2one('yuthon.property', string='关联物业信息') @api.onchange('building_area') def _onchange_building_area(self): @@ -134,6 +138,7 @@ class YuthonProperty(models.Model): 'default_property_id': self.id } } + def put_adjustment_approval(self): form_id = self.env.ref('yuthon_property_approval.view_property_rental_conditions_form').id return { @@ -146,6 +151,7 @@ class YuthonProperty(models.Model): 'default_property_id': self.id } } + def put_property_handover(self): property_ids = self.env["yuthon.property"].browse( self._context.get('active_ids', self._context.get('active_id'))) @@ -193,7 +199,6 @@ class YuthonProperty(models.Model): 'rental_conditions': record.rental_conditions, 'state':record.state, 'remarks': record.remarks}]) - return { 'name': '提交物业评估', 'view_mode': 'form', @@ -204,6 +209,37 @@ class YuthonProperty(models.Model): 'default_evaluate_application_ids': property_list } } + # 拆分 + def put_split_approval(self): + form_id = self.env.ref('yuthon_property_approval.view_property_split_approval_form').id + return { + 'name': '拆分物业审批', + 'view_mode': 'form', + 'res_model': 'property.split.approval', + 'type': 'ir.actions.act_window', + 'views': [(form_id, 'form')], + 'context': { + 'default_property_id': self.id + }} + # 合并 + def put_merge_approval(self): + 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_merge_approval_form').id + property_list = [] + for record in property_ids: + property_list.append([0, 0, { + 'property_id': record.id + }]) + return { + 'name': '合并物业审批', + 'view_mode': 'form', + 'res_model': 'property.merge.approval', + 'type': 'ir.actions.act_window', + 'views': [(form_id, 'form')], + 'context': { + 'default_property_merge_approval_line_ids':property_list + }} class YuthonPropertyWater(models.Model): _name = 'yuthon.property.water' @@ -269,7 +305,7 @@ class ManageInformationLine(models.Model): purpose_id = fields.Many2one('yuthon.resource.purpose', string="资产用途") precinct = fields.Char(string="片区") admin_id = fields.Many2one('res.users', string="管理员") - company_page = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储'), ('tj', '天河投建')], + yuthon_company = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储'), ('tj', '天河投建')], string="所属公司") start_time = fields.Date(string="生效日期") end_date = fields.Date(string="失效日期") @@ -277,10 +313,11 @@ class ManageInformationLine(models.Model): class DisassemblyInformationLine(models.Model): _name = 'disassembly.information.line' - _description = '拆合信息明细行' + _description = '拆分信息明细行' yuthon_property_id = fields.Many2one('yuthon.property', string="关联物业信息") - property_name = fields.Char(string="物业名称") # 逻辑没搞清,暂时先放这里 - rent_area = fields.Float(string="可租面积") + property_id = fields.Many2one('yuthon.property', string="物业名称") + rent_area = fields.Float(related='property_id.rentable_area', string="可租面积") start_time = fields.Date(string="生效日期") end_date = fields.Date(string="失效日期") + diff --git a/yuthon_property/views/menuitem.xml b/yuthon_property/views/menuitem.xml index 6ba1ebe9b..bafcd0e1c 100644 --- a/yuthon_property/views/menuitem.xml +++ b/yuthon_property/views/menuitem.xml @@ -298,17 +298,34 @@ parent="resource_management_menu" name="客户信息" sequence="2"/> - + + + + + +