diff --git a/soong_workflow/models/soong_user_role.py b/soong_workflow/models/soong_user_role.py index a58677230..c4b73c0c1 100644 --- a/soong_workflow/models/soong_user_role.py +++ b/soong_workflow/models/soong_user_role.py @@ -21,7 +21,7 @@ class YuthonUserRole(models.Model): personnel = fields.Text(string="在岗人员", compute='_compute_personnel') employee_ids = fields.One2many('hr.employee', 'user_role_id') number_people = fields.Integer(string="在岗人数", compute='_compute_number_people') - child_ids = fields.One2many('soong.user.role', 'parent_id', string='子集角色', index=True) + child_ids = fields.One2many('soong.user.role', 'parent_id', string='下级角色', index=True) yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储'), ('thtjbb', '天河投资本部')], string="所属公司", compute='compute_company') pinyin_name = fields.Char(string="拼音名称", compute='_compute_pinyin', index=True, store=True) diff --git a/soong_workflow/views/soong_workflow_log_views.xml b/soong_workflow/views/soong_workflow_log_views.xml index 66c519e17..0f5b52253 100644 --- a/soong_workflow/views/soong_workflow_log_views.xml +++ b/soong_workflow/views/soong_workflow_log_views.xml @@ -5,7 +5,7 @@ soong.workflow.log.tree soong.workflow.log - + diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index 018a9be37..9badd12d8 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -131,7 +131,7 @@ class HolidaysRequestBatch(models.Model): details = fields.Text(string="假期流程说明", compute='_compute_details') days = fields.Float(string='天数') hours = fields.Float(string='小时') - text = fields.Html(string='申请事由') + text = fields.Text(string='申请事由') is_day = fields.Boolean(string='按天请假') is_hour = fields.Boolean(string='按小时请假') leave_ids = fields.One2many(string='按天请假详情', comodel_name='hr.leave', inverse_name='batch_id', domain=[('leave_type_request_unit', '=', 'day')]) diff --git a/yuthon_holiday/views/hr_leave_batch.xml b/yuthon_holiday/views/hr_leave_batch.xml index 11b285bc6..0bc11f7ac 100644 --- a/yuthon_holiday/views/hr_leave_batch.xml +++ b/yuthon_holiday/views/hr_leave_batch.xml @@ -36,9 +36,6 @@ - - - + + + diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py index 17c222cb9..cb98c4c67 100644 --- a/yuthon_property/models/yuthon_property.py +++ b/yuthon_property/models/yuthon_property.py @@ -59,14 +59,14 @@ class YuthonProperty(models.Model): description = fields.Html(string="描述") is_message_fee = fields.Boolean(string="管理费") message_standard_id = fields.Many2one('property.message.fee', string="管理费标准") - code = fields.Char(string="编号", - default=lambda self: self.env['ir.sequence'].next_by_code('property_message_code')) + code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_message_code')) rental_unit_price = fields.Float(string="评估单价") address = fields.Text(string="物业地址") title_number = fields.Char(string="产权编号") suite_area = fields.Float(string="套内面积") start_time = fields.Date(string="生效时间") end_date = fields.Date(string="失效日期") + lessee_id = fields.Many2one('yuthon.property.lessee', string='承租方') manage_standard = fields.Char(string="物业管理费标准") title_address = fields.Char(string="产权地址") rental_address = fields.Char(string="出租地址") @@ -240,6 +240,7 @@ class YuthonProperty(models.Model): 'default_property_merge_approval_line_ids':property_list }} + class YuthonPropertyWater(models.Model): _name = 'yuthon.property.water' _description = '水表' diff --git a/yuthon_property/views/yuthon_property_views.xml b/yuthon_property/views/yuthon_property_views.xml index 31ee8dc50..0340e686c 100644 --- a/yuthon_property/views/yuthon_property_views.xml +++ b/yuthon_property/views/yuthon_property_views.xml @@ -29,6 +29,7 @@ + @@ -65,7 +66,7 @@ - + @@ -119,7 +120,7 @@ - + @@ -188,7 +189,6 @@ - @@ -225,6 +225,10 @@ 管理员: +
+ 承租方: + +
diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index 5e9a4d58e..70700adb1 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -66,9 +66,6 @@ class PropertyLeaseContract(models.Model): percentage_liquidated_damages = fields.Char(string="违约金比例") date_of_payment = fields.Date(string="每月支付日期") unit_price = fields.Float(string="单价") - management_fee = fields.Float(string="管理费") - water = fields.Float(string="水费") - tariff = fields.Float(string="电费") deposit = fields.Float(string="押金/履约保证金") first_year_rent = fields.Float(string="首年租金") total_contract_receivables = fields.Float(string="合同应收") @@ -76,7 +73,7 @@ class PropertyLeaseContract(models.Model): not_tax_amount = fields.Float(string="不含税价") tax = fields.Float(string="税金") miscellaneous = fields.Char(string="其他约定") - total_area = fields.Float(string="总面积") + total_area = fields.Float(string="总面积", digits=(16, 4)) lease_ids = fields.One2many('property.lease.contract.line', 'lease_id',string="租赁信息明细行") breakdown_ids = fields.One2many('property.rent.breakdown.line', 'breakdown_id', string="物业租金明细行") @@ -353,6 +350,11 @@ class PropertyLeaseContract(models.Model): "period_rent": monthly_amount * months, }) + @api.onchange("first_year_rent") + def _onchange_first_year_rent(self): + for rec in self: + rec.deposit = rec.first_year_rent * 2 + class PropertyLeaseContractLine(models.Model): _name = 'property.lease.contract.line' _description = '物业列表明细行' diff --git a/yuthon_property_approval/models/property_offline_registration.py b/yuthon_property_approval/models/property_offline_registration.py index 7c07da8c8..631986389 100644 --- a/yuthon_property_approval/models/property_offline_registration.py +++ b/yuthon_property_approval/models/property_offline_registration.py @@ -13,7 +13,7 @@ class PropertyOfflineRegistration(models.Model): rental_price = fields.Float(string='租金底价(元/m²)') monthly_rent = fields.Float(string='月租金(元)') increment_rate = fields.Char(string='递增率') - rent_free = fields.Char(string='免租期') + rent_free = fields.Datetime(string='免租期') contract_years = fields.Char(string='签约年限') start_data = fields.Date(string="报价开始日期") end_data = fields.Date(string="报价结束日期") diff --git a/yuthon_property_approval/models/property_split_approval.py b/yuthon_property_approval/models/property_split_approval.py index 1d634f660..d9cf22018 100644 --- a/yuthon_property_approval/models/property_split_approval.py +++ b/yuthon_property_approval/models/property_split_approval.py @@ -1,4 +1,5 @@ from odoo import models, fields, api, exceptions, _ +from odoo.exceptions import UserError class PropertySplitApproval(models.Model): @@ -6,8 +7,7 @@ class PropertySplitApproval(models.Model): _inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin'] _description = '物业拆分审批' - code = fields.Char(string="编号", - default=lambda self: self.env['ir.sequence'].next_by_code('property_split_approval_code')) + code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_split_approval_code')) users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id) department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门") property_id = fields.Many2one('yuthon.property', string='物业名称') @@ -23,25 +23,20 @@ class PropertySplitApproval(models.Model): reason = fields.Html(string="正文") notice_documents_ids = fields.Many2many('ir.attachment', string="附件") property_split_approval_line_ids = fields.One2many('property.split.approval.line', 'property_split_approval_id', string='关联物业拆分明细行') - split_quantity = fields.Integer(string='拆分数量') + split_quantity = fields.Integer(string='拆分数量', default=2) - #自由拆分 - @api.onchange('split_quantity') - def onchange_split_quantity(self): - self.property_split_approval_line_ids.unlink() - for i in range(self.split_quantity): - self.property_split_approval_line_ids.create({ - 'property_split_approval_id': self.id, - 'split_property':self.property_id.name + '-'+str(i+1)}) - - # #平均拆分 - # def put_evaluation_splitting(self): - # for i in range(self.split_quantity): - # self.env['property.split.approval.line'].create({ - # 'property_split_approval_id': self.id, - # 'split_property': self.property_id.name + '-' + str(i + 1), - # 'split_building_area': self.property_id.building_area/self.split_quantity, - # 'split_rent_area': self.property_id.rent_area/self.split_quantity}) + def property_split_button(self): + if self.split_quantity < 2: + raise UserError('拆分数量必须是大于2') + if self.id.origin and self.property_id: + lines_to_create = [] + for i in range(self.split_quantity): + lines_to_create.append({ + 'property_split_approval_id': self.id.origin, + 'split_property': f"{self.property_id.name}-{i + 1}" + }) + self.property_split_approval_line_ids.unlink() + self.env['property.split.approval.line'].create(lines_to_create) def put_split_message(self): property_list = [] @@ -58,6 +53,7 @@ class PropertySplitApproval(models.Model): self.property_id.write({'is_done_split': True}) self.property_id.disassembly_information_ids = property_list + class PropertySplitApprovalLine(models.Model): _name = 'property.split.approval.line' _description = '物业拆分明细行' diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml index 22af8395b..49341e848 100644 --- a/yuthon_property_approval/views/property_lease_contract.xml +++ b/yuthon_property_approval/views/property_lease_contract.xml @@ -60,8 +60,9 @@
- - + + +
@@ -81,9 +82,9 @@ - - + + @@ -92,23 +93,18 @@ - - + - + - - - -
diff --git a/yuthon_property_approval/views/property_split_approval_views.xml b/yuthon_property_approval/views/property_split_approval_views.xml index ee45d488b..6efc855a8 100644 --- a/yuthon_property_approval/views/property_split_approval_views.xml +++ b/yuthon_property_approval/views/property_split_approval_views.xml @@ -37,6 +37,8 @@ + +