diff --git a/soong_workflow/views/soong_workflow_record.xml b/soong_workflow/views/soong_workflow_record.xml index 5d9e00fd4..112cd6d01 100644 --- a/soong_workflow/views/soong_workflow_record.xml +++ b/soong_workflow/views/soong_workflow_record.xml @@ -7,6 +7,7 @@ + diff --git a/yuthon_hr_employee/views/yuthon_hr_department_views.xml b/yuthon_hr_employee/views/yuthon_hr_department_views.xml index 3355139c8..c887da2fd 100644 --- a/yuthon_hr_employee/views/yuthon_hr_department_views.xml +++ b/yuthon_hr_employee/views/yuthon_hr_department_views.xml @@ -52,6 +52,18 @@ + + inherit.hr.department.search + hr.department + + + + + + + + + 批量生成权限组 diff --git a/yuthon_notice/views/yuthon_notice_views.xml b/yuthon_notice/views/yuthon_notice_views.xml index 68b841b7a..f472581c2 100644 --- a/yuthon_notice/views/yuthon_notice_views.xml +++ b/yuthon_notice/views/yuthon_notice_views.xml @@ -71,7 +71,7 @@ - + diff --git a/yuthon_property/views/yuthon_precinct_message_views.xml b/yuthon_property/views/yuthon_precinct_message_views.xml index c72eadf54..dc2cff30a 100644 --- a/yuthon_property/views/yuthon_precinct_message_views.xml +++ b/yuthon_property/views/yuthon_precinct_message_views.xml @@ -6,8 +6,8 @@ - + diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index 5fd7f5df4..0dd500a11 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -42,6 +42,7 @@ class PropertyLeaseContract(models.Model): name = fields.Char(string='物业信息') code = fields.Char(string="流水号", default=lambda self: self.env['ir.sequence'].next_by_code('property_lease_contract_code')) admin_id = fields.Many2one('res.users', string="管理员") + tenure_type = fields.Selection([('self', '自有'), ('agency', '代管')], string='权属类型') contract_code = fields.Char(string="合同编号") contract_date = fields.Date(string="合同签订日期") property_documents_ids = fields.Many2many('ir.attachment', string="租赁合同文件") @@ -157,6 +158,9 @@ class PropertyLeaseContract(models.Model): responsibility_book_id = fields.Many2one('ir.attachment', string="安全生产责任书(住宅)") other_id = fields.Many2one('ir.attachment', string="其他") handover_time = fields.Date(string="交接日期") + contract_source_id = fields.Many2one('property.lease.contract', string="合同来源") + is_child_contract = fields.Boolean(string="是否子合同") + is_contract = fields.Boolean(string="是否主合同") urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度', default='normal') work_end = fields.Boolean(string="结束") @@ -203,6 +207,7 @@ class PropertyLeaseContract(models.Model): contract_ids = self.env["property.lease.contract"].browse( self._context.get('active_ids', self._context.get('active_id'))) for record in contract_ids: + if record.term_start_time: record.actual_start_time = record.term_start_time if record.term_end_time: @@ -904,6 +909,7 @@ class PropertyLeaseContract(models.Model): rec.electricity_fee_ids = [(5, 0, 0)] rec.mange_fee_ids = [(5, 0, 0)] rec.admin_id = rec.lease_ids[0].admin_line_id.id if rec.lease_ids else '' + rec.tenure_type = rec.lease_ids[0].address_id.tenure_type if rec.lease_ids else '' rec.company_id = rec.lease_ids[0].address_id.company_id.id if rec.lease_ids else '' rec.precinct_id = rec.lease_ids[0].address_id.precinct_id.id if rec.lease_ids else '' rec.total_area = sum([lease.property_area for lease in rec.lease_ids]) @@ -915,12 +921,11 @@ class PropertyLeaseContract(models.Model): for record in property_ids: company_id = record.lease_ids[0].address_id.company_id.id if record.lease_ids else '' admin_id = record.lease_ids[0].admin_line_id.id if record.lease_ids else '' - record.write({'company_id': company_id, + tenure_type = record.lease_ids[0].address_id.tenure_type if record.lease_ids else '' + record.sudo().write({'company_id': company_id, 'admin_id': admin_id, - 'actual_end_time': datetime.now(), - 'precinct_id': record.lease_ids[0].address_id.precinct_id.id if record.lease_ids else '', - 'use_address': record.name, - 'address_for_delivery': record.name,}) + 'tenure_type':tenure_type, + 'precinct_id': record.lease_ids[0].address_id.precinct_id.id if record.lease_ids else '',}) def action_yuthon_property_contract_wizard(self): return { @@ -979,9 +984,14 @@ class PropertyLeaseContract(models.Model): def action_copy_record1(self): for record in self: + record.is_contract = True + record.is_child_contract = False record.number += 1 contract_id = self.env['property.lease.contract'].create({ 'name': record.name, + 'is_child_contract': True, + 'is_contract': False, + 'contract_source_id': record.id, 'actual_start_time': record.actual_start_time, 'actual_end_time': record.actual_end_time, 'contract_code': record.contract_code+ f'-{record.number}', @@ -1088,7 +1098,7 @@ class PropertyLeaseContract(models.Model): }]) rent_list = [] if record.rent_list_ids: - for record in record.rent_list_ids: + for rent in record.rent_list_ids: rent_list.append([0, 0, { 'contract_id': contract_id.id, }]) @@ -1099,11 +1109,11 @@ class PropertyLeaseContract(models.Model): # management_list.append([0, 0, { # 'contract_id': contract_id.id, # }]) - # subset_list = [] - # subset_list.append([0, 0, { - # 'subset_id': record.id, - # 'contract_id': contract_id.id, }]) - # record.subset_ids = subset_list + subset_list = [] + subset_list.append([0, 0, { + 'subset_id': record.id, + 'contract_id': contract_id.id}]) + record.subset_ids = subset_list contract_id.write({ 'lease_ids': lease_list, 'breakdown_ids': breakdown_list, @@ -1379,4 +1389,7 @@ class PropertySubsetContract(models.Model): _description = '物业子合同明细' subset_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批") - contract_id = fields.Many2one('property.lease.contract', string="关联合同审批") \ No newline at end of file + contract_id = fields.Many2one('property.lease.contract', string="合同") + name = fields.Char(related='contract_id.name', string="物业信息") + lessee_id = fields.Many2one(related='contract_id.lessee_id', string="承租方") + rental_purposes = fields.Many2one(related='contract_id.rental_purposes', string="出租用途") \ No newline at end of file diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml index c0b9c59ff..f1dd1bc00 100644 --- a/yuthon_property_approval/views/property_lease_contract.xml +++ b/yuthon_property_approval/views/property_lease_contract.xml @@ -77,6 +77,10 @@ + + + + @@ -133,6 +137,17 @@ + + + + + + + + + + + @@ -429,8 +444,12 @@ + + + + @@ -493,6 +512,17 @@ + + + + + + + + + + + @@ -709,6 +739,7 @@ + diff --git a/yuthon_property_approval/views/property_management.xml b/yuthon_property_approval/views/property_management.xml index bd94b259d..fdd263005 100644 --- a/yuthon_property_approval/views/property_management.xml +++ b/yuthon_property_approval/views/property_management.xml @@ -71,7 +71,7 @@ - + diff --git a/yuthon_trade/models/yuthon_task_approval.py b/yuthon_trade/models/yuthon_task_approval.py index 169fd3962..d46bbf23e 100644 --- a/yuthon_trade/models/yuthon_task_approval.py +++ b/yuthon_trade/models/yuthon_task_approval.py @@ -19,8 +19,8 @@ class YuthonTaskApproval(models.Model): employee_ids = fields.Many2many('hr.employee', string="作业人员") task_id = fields.Many2one('yuthon.task.setting', string="作业项目") stack_position_ids = fields.Many2many('yuthon.stack.position', string="作业堆位") - task_start_time = fields.Datetime(string="作业开始时间", default=lambda self: fields.Datetime.to_string(datetime.now() - timedelta(hours=8))) - task_end_time = fields.Datetime(string="作业结束时间", default=lambda self: fields.Datetime.to_string(datetime.combine(datetime.now().date(), time(8, 0)))) + task_start_time = fields.Datetime(string="作业开始时间", default=lambda self: fields.Datetime.to_string(datetime.combine(datetime.now().date(), time(0, 30)))) + task_end_time = fields.Datetime(string="作业结束时间", default=lambda self: fields.Datetime.to_string(datetime.combine(datetime.now().date(), time(8, 30)))) urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度', default='normal') active = fields.Boolean('Active', default=True, tracking=True) @@ -51,4 +51,10 @@ class YuthonTaskApproval(models.Model): delta = end - start record.duration = delta.total_seconds() / 3600 else: - record.duration = 0 \ No newline at end of file + record.duration = 0 + + @api.constrains('task_start_time', 'task_end_time') + def _check_task_end_time(self): + for record in self: + if record.task_start_time and record.task_end_time and record.task_start_time > record.task_end_time: + raise models.ValidationError("开始时间不能大于结束时间!") \ No newline at end of file