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 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/yuthon_property/views/yuthon_resource_mgmt_config_views.xml b/yuthon_property/views/yuthon_resource_mgmt_config_views.xml index 9343d2cb6..78826ebae 100644 --- a/yuthon_property/views/yuthon_resource_mgmt_config_views.xml +++ b/yuthon_property/views/yuthon_resource_mgmt_config_views.xml @@ -90,5 +90,18 @@ yuthon.property.source tree - + + yuthon.owner.message.tree + yuthon.owner.message + + + + + + + + 物业来源 + yuthon.owner.message + tree + diff --git a/yuthon_property_approval/models/property_evaluate_application.py b/yuthon_property_approval/models/property_evaluate_application.py index 31bf9691d..5e7195af4 100644 --- a/yuthon_property_approval/models/property_evaluate_application.py +++ b/yuthon_property_approval/models/property_evaluate_application.py @@ -15,15 +15,54 @@ class PropertyEvaluateApplication(models.Model): is_experts = fields.Boolean(string="是否需要专家评审") notice_documents_ids = fields.Many2many('ir.attachment', string='议题附件') issue_library_id = fields.Many2one('issue.library', string='关联议题') - yuthon_property_ids = fields.One2many('yuthon.property', 'property_message_id', string='物业信息明细行') + evaluate_application_ids = fields.One2many('evaluate.application.line', 'property_message_id', string='物业信息明细行') - # def put(self): - # done_ids = self.env["property.evaluate.application"].browse(self._context.get('active_ids', self._context.get('active_id'))) - # form_id = self.env.ref('yuthon_property_approval.view_property_handover_form').id - # return { - # 'name': '已评估', - # 'type': 'ir.actions.act_window', - # 'res_model': 'property.evaluate.application', - # 'view_mode': 'form', - # 'views': [(form_id, 'form')], + def put_property_record(self): + property_ids = self.env["property.evaluate.application"].browse( + self._context.get('active_ids', self._context.get('active_id'))) + form_id = self.env.ref('yuthon_property_approval.view_property_record_form').id + property_list = [] + for i in property_ids: + for record in i.evaluate_application_ids: + property_list.append([0, 0, {'product': record.name, + 'state': record.state, + 'property_type':record.assessment_category, + 'property_m2': record.evaluation_area,} + ]) + return { + 'name': '提交物业备案审批', + 'view_mode': 'form', + 'res_model': 'property.record', + 'type': 'ir.actions.act_window', + 'views': [(form_id, 'form')], + "context": { + 'default_property_record_line_ids':property_list + } + } +class EvaluateApplicationLine(models.Model): + _name = 'evaluate.application.line' + _description = '物业信息明细行' + + property_message_id = fields.Many2one('property.evaluate.application', string='关联评估申请') + 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_approval/models/property_record.py b/yuthon_property_approval/models/property_record.py index 51ab4f751..7ffc8aa5d 100644 --- a/yuthon_property_approval/models/property_record.py +++ b/yuthon_property_approval/models/property_record.py @@ -14,19 +14,23 @@ class PropertyRecord(models.Model): code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_record_code')) property_documents_ids = fields.Many2many('documents.document', string="物业备案文件") property_record_line_ids = fields.One2many('property.record.line', 'property_record_id', string="评估文件") - + is_issues = fields.Boolean(string='是否上会') + related_issues_id = fields.Many2one('issue.library', string="关联议题") class PropertyRecordLine(models.Model): _name = 'property.record.line' property_record_id = fields.Many2one('property.record', string='关联审批') - product_id = fields.Many2one('product.product', string="物业") + product = fields.Char(string="物业") product_code = fields.Char(string="评估编号") partner_id = fields.Many2one('res.partner', string="评估公司") - property_statu = fields.Char(string="评估状态") property_type = fields.Selection([('rent_money', '租金'), ('value', '价值')], string="评估类别") property_m2 = fields.Float(string="评估面积") - + state = fields.Selection([('to', '待评估'), ('done', '已评估'), ('ing', '评估中'), + ('ing_handover', '移交中'), ('done_handover', '已移交'), + ('filing', '备案中'), ('net', '挂网'), ('signing', '签约中'), + ('signed', '已备案'), ('leased', '已出租'), ('idle', '闲置')], string='状态', + default='to') diff --git a/yuthon_property_approval/security/ir.model.access.csv b/yuthon_property_approval/security/ir.model.access.csv index 0321f4e0a..750f56bd2 100644 --- a/yuthon_property_approval/security/ir.model.access.csv +++ b/yuthon_property_approval/security/ir.model.access.csv @@ -42,4 +42,6 @@ access_property_approval,property_approval,model_property_approval,base.group_us access_property_approval_line,property_approval_line,model_property_approval_line,base.group_user,1,1,1,1 access_property_handover,property_handover,model_property_handover,base.group_user,1,1,1,1 access_property_handover_line,property_handover_line,model_property_handover_line,base.group_user,1,1,1,1 -access_property_inducts_wizard,property_inducts_wizard,model_property_inducts_wizard,base.group_user,1,1,1,1 \ No newline at end of file +access_property_inducts_wizard,property_inducts_wizard,model_property_inducts_wizard,base.group_user,1,1,1,1 +access_evaluate_application_line,evaluate_application_line,model_evaluate_application_line,base.group_user,1,1,1,1 +access_property_record_line,property_record_line,model_property_record_line,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/yuthon_property_approval/views/property_evaluate_application_views.xml b/yuthon_property_approval/views/property_evaluate_application_views.xml index 6f7366b43..b91350341 100644 --- a/yuthon_property_approval/views/property_evaluate_application_views.xml +++ b/yuthon_property_approval/views/property_evaluate_application_views.xml @@ -5,6 +5,9 @@ property.evaluate.application +
+
@@ -17,11 +20,6 @@
-
-

- -

-
@@ -38,19 +36,21 @@ - + + - + - + + diff --git a/yuthon_property_approval/views/property_record_views.xml b/yuthon_property_approval/views/property_record_views.xml index 8af6e11cf..d2075838b 100644 --- a/yuthon_property_approval/views/property_record_views.xml +++ b/yuthon_property_approval/views/property_record_views.xml @@ -31,21 +31,25 @@ + - + - + + + +