From f47824f9e14b163584a9cbf82f23e9e12ce9a872 Mon Sep 17 00:00:00 2001 From: ljmwkx <1340053001@qq.com> Date: Sun, 2 Mar 2025 09:21:40 +0800 Subject: [PATCH 1/3] 1 --- .../models/hr_attendance_detail_wechat.py | 563 +++++++++--------- 1 file changed, 288 insertions(+), 275 deletions(-) diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index b3eab31a7..6a365a312 100644 --- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py +++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py @@ -460,46 +460,49 @@ class HrAttendanceDetail(models.Model): else: # 多次打卡时间的集合 checkin_time_list = [obj.checkin_time for obj in attendance_detail_obj_in] - # 最早 时间 - min_time = min(checkin_time_list) - # 查询最早时间上班时间 查询最晚下班时间 - # 判断时间 在10分钟内说明是 异常 - if will_datetime_start + timedelta(minutes=10) > min_time > will_datetime_start: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": min_time, - "is_late_card": False, - "is_no_card": False, - "is_abnormal": True, - "absenteeism_card": False, - }) - elif will_datetime_start + timedelta(hours=1) > min_time > will_datetime_start: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": min_time, - "is_late_card": True, - "is_no_card": False, - "is_abnormal": False, - "absenteeism_card": False, - }) - elif min_time > will_datetime_start + timedelta(hours=1) and min_time > will_datetime_start: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": min_time, - "is_late_card": False, - "is_no_card": False, - "is_abnormal": False, - "absenteeism_card": True, - }) + if not checkin_time_list: + attendance_obj.sudo().write({"is_no_card": True, "is_abnormal": True}) else: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": min_time, - "is_late_card": min_time > will_datetime_start, - "is_no_card": False, - "is_abnormal": False, - "absenteeism_card": False, - }) + # 最早 时间 + min_time = min(checkin_time_list) + # 查询最早时间上班时间 查询最晚下班时间 + # 判断时间 在10分钟内说明是 异常 + if will_datetime_start + timedelta(minutes=10) > min_time > will_datetime_start: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": min_time, + "is_late_card": False, + "is_no_card": False, + "is_abnormal": True, + "absenteeism_card": False, + }) + elif will_datetime_start + timedelta(hours=1) > min_time > will_datetime_start: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": min_time, + "is_late_card": True, + "is_no_card": False, + "is_abnormal": False, + "absenteeism_card": False, + }) + elif min_time > will_datetime_start + timedelta(hours=1) and min_time > will_datetime_start: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": min_time, + "is_late_card": False, + "is_no_card": False, + "is_abnormal": False, + "absenteeism_card": True, + }) + else: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": min_time, + "is_late_card": min_time > will_datetime_start, + "is_no_card": False, + "is_abnormal": False, + "absenteeism_card": False, + }) # 下班 attendance_detail_obj_out = self.env['hr.attendance.detail'].sudo().search( [("exception_type", "!=", "未打卡"), @@ -513,28 +516,29 @@ class HrAttendanceDetail(models.Model): if is_resource_user: # 多次打卡时间的集合 checkin_time_list = [obj.checkin_time for obj in attendance_detail_obj_out] - # 最早 时间 - max_time = max(checkin_time_list) - # 如果上班没有打卡 - if not attendance_obj.check_in: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": max_time, - "is_late_card": False, - "is_no_card": False, - "is_abnormal": False, - "absenteeism_card": False, - }) - # 如果上班时间早于下班时间说明 - elif attendance_obj.check_in and attendance_obj.check_in < max_time: - attendance_obj.sudo().write({ - "sch_check_out_time": will_datetime_end, - "check_out": max_time, - "is_early_card": False, - "is_no_card": False, - "is_abnormal": False, - "absenteeism_card": False, - }) + if checkin_time_list: + # 最早 时间 + max_time = max(checkin_time_list) + # 如果上班没有打卡 + if not attendance_obj.check_in: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": max_time, + "is_late_card": False, + "is_no_card": False, + "is_abnormal": False, + "absenteeism_card": False, + }) + # 如果上班时间早于下班时间说明 + elif attendance_obj.check_in and attendance_obj.check_in < max_time: + attendance_obj.sudo().write({ + "sch_check_out_time": will_datetime_end, + "check_out": max_time, + "is_early_card": False, + "is_no_card": False, + "is_abnormal": False, + "absenteeism_card": False, + }) else: if len(attendance_detail_obj_out) <= 0: attendance_obj.sudo().write({"is_no_card": True, "is_abnormal": True, "absenteeism_card": True}) @@ -542,87 +546,90 @@ class HrAttendanceDetail(models.Model): else: # 多次打卡时间的集合 checkin_time_list = [obj.checkin_time for obj in attendance_detail_obj_out] - # 最早 时间 - max_time = max(checkin_time_list) - # 如果上班没有打卡 - if not attendance_obj.check_in: - if will_datetime_start + timedelta(minutes=10) > max_time > will_datetime_start: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": max_time, - "is_late_card": False, - "is_no_card": True, - "is_abnormal": True, - "absenteeism_card": True, - }) - elif will_datetime_start + timedelta(hours=1) > max_time > will_datetime_start: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": max_time, - "is_late_card": True, - "is_no_card": True, - "is_abnormal": True, - "absenteeism_card": True, - }) - elif max_time > will_datetime_start + timedelta(hours=1) and max_time > will_datetime_start: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": max_time, - "is_late_card": False, - "is_no_card": True, - "is_abnormal": True, - "absenteeism_card": True, - }) - else: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": max_time, - "is_late_card": max_time > will_datetime_start, - "is_no_card": True, - "is_abnormal": True, - "absenteeism_card": True, - }) - - # 如果上班时间早于下班时间说明下班的卡没打 - elif attendance_obj.check_in >= max_time: + if not checkin_time_list: attendance_obj.sudo().write({"is_no_card": True, "is_abnormal": True, "absenteeism_card": True}) else: - if will_datetime_end - timedelta(minutes=10) < max_time < will_datetime_end: - attendance_obj.sudo().write({ - "sch_check_out_time": will_datetime_end, - "check_out": max_time, - "is_early_card": False, - "is_no_card": False, - "is_abnormal": True, - # "absenteeism_card": False, - }) - elif will_datetime_end - timedelta(hours=1) < max_time < will_datetime_end: - attendance_obj.sudo().write({ - "sch_check_out_time": will_datetime_end, - "check_out": max_time, - "is_early_card": True, - "is_no_card": False, - # "is_abnormal": False, - # "absenteeism_card": False, - }) - elif max_time < will_datetime_end - timedelta(hours=1): - attendance_obj.sudo().write({ - "sch_check_out_time": will_datetime_end, - "check_out": max_time, - "is_early_card": False, - "is_no_card": False, - # "is_abnormal": False, - "absenteeism_card": True, - }) + # 最早 时间 + max_time = max(checkin_time_list) + # 如果上班没有打卡 + if not attendance_obj.check_in: + if will_datetime_start + timedelta(minutes=10) > max_time > will_datetime_start: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": max_time, + "is_late_card": False, + "is_no_card": True, + "is_abnormal": True, + "absenteeism_card": True, + }) + elif will_datetime_start + timedelta(hours=1) > max_time > will_datetime_start: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": max_time, + "is_late_card": True, + "is_no_card": True, + "is_abnormal": True, + "absenteeism_card": True, + }) + elif max_time > will_datetime_start + timedelta(hours=1) and max_time > will_datetime_start: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": max_time, + "is_late_card": False, + "is_no_card": True, + "is_abnormal": True, + "absenteeism_card": True, + }) + else: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": max_time, + "is_late_card": max_time > will_datetime_start, + "is_no_card": True, + "is_abnormal": True, + "absenteeism_card": True, + }) + + # 如果上班时间早于下班时间说明下班的卡没打 + elif attendance_obj.check_in >= max_time: + attendance_obj.sudo().write({"is_no_card": True, "is_abnormal": True, "absenteeism_card": True}) else: - attendance_obj.sudo().write({ - "sch_check_out_time": will_datetime_end, - "check_out": max_time, - "is_early_card": max_time < will_datetime_end, - "is_no_card": False, - # "is_abnormal": False, - # "absenteeism_card": False, - }) + if will_datetime_end - timedelta(minutes=10) < max_time < will_datetime_end: + attendance_obj.sudo().write({ + "sch_check_out_time": will_datetime_end, + "check_out": max_time, + "is_early_card": False, + "is_no_card": False, + "is_abnormal": True, + # "absenteeism_card": False, + }) + elif will_datetime_end - timedelta(hours=1) < max_time < will_datetime_end: + attendance_obj.sudo().write({ + "sch_check_out_time": will_datetime_end, + "check_out": max_time, + "is_early_card": True, + "is_no_card": False, + # "is_abnormal": False, + # "absenteeism_card": False, + }) + elif max_time < will_datetime_end - timedelta(hours=1): + attendance_obj.sudo().write({ + "sch_check_out_time": will_datetime_end, + "check_out": max_time, + "is_early_card": False, + "is_no_card": False, + # "is_abnormal": False, + "absenteeism_card": True, + }) + else: + attendance_obj.sudo().write({ + "sch_check_out_time": will_datetime_end, + "check_out": max_time, + "is_early_card": max_time < will_datetime_end, + "is_no_card": False, + # "is_abnormal": False, + # "absenteeism_card": False, + }) return True def _do_planning_role(self, user, current_date, attendance_obj, planning_id): @@ -699,51 +706,54 @@ class HrAttendanceDetail(models.Model): else: # 多次打卡时间的集合 checkin_time_list = [obj.checkin_time for obj in attendance_detail_obj_in] - # 最早 时间 - min_time = min(checkin_time_list) - # attendance_obj.sudo().write({ - # "sch_check_in_time": planning_id.start_datetime, - # "check_in": min_time, - # "is_late_card": min_time > planning_id.start_datetime, - # "is_no_card": False, - # "is_abnormal": False, - # }) - if will_datetime_start + timedelta(minutes=10) > min_time > will_datetime_start: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": min_time, - "is_late_card": False, - "is_no_card": False, - "is_abnormal": True, - "absenteeism_card": False, - }) - elif will_datetime_start + timedelta(hours=1) > min_time > will_datetime_start: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": min_time, - "is_late_card": True, - "is_no_card": False, - "is_abnormal": False, - "absenteeism_card": False, - }) - elif min_time > will_datetime_start + timedelta(hours=1) and min_time > will_datetime_start: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": min_time, - "is_late_card": False, - "is_no_card": False, - "is_abnormal": False, - "absenteeism_card": True, - }) + if not checkin_time_list: + attendance_obj.sudo().write({"is_no_card": True, "is_abnormal": True, "absenteeism_card": True}) else: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": min_time, - "is_late_card": min_time > will_datetime_start, - "is_no_card": False, - "is_abnormal": False, - "absenteeism_card": False, - }) + # 最早 时间 + min_time = min(checkin_time_list) + # attendance_obj.sudo().write({ + # "sch_check_in_time": planning_id.start_datetime, + # "check_in": min_time, + # "is_late_card": min_time > planning_id.start_datetime, + # "is_no_card": False, + # "is_abnormal": False, + # }) + if will_datetime_start + timedelta(minutes=10) > min_time > will_datetime_start: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": min_time, + "is_late_card": False, + "is_no_card": False, + "is_abnormal": True, + "absenteeism_card": False, + }) + elif will_datetime_start + timedelta(hours=1) > min_time > will_datetime_start: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": min_time, + "is_late_card": True, + "is_no_card": False, + "is_abnormal": False, + "absenteeism_card": False, + }) + elif min_time > will_datetime_start + timedelta(hours=1) and min_time > will_datetime_start: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": min_time, + "is_late_card": False, + "is_no_card": False, + "is_abnormal": False, + "absenteeism_card": True, + }) + else: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": min_time, + "is_late_card": min_time > will_datetime_start, + "is_no_card": False, + "is_abnormal": False, + "absenteeism_card": False, + }) # 下班 attendance_detail_obj_out = self.env['hr.attendance.detail'].sudo().search( @@ -761,101 +771,104 @@ class HrAttendanceDetail(models.Model): else: # 多次打卡时间的集合 checkin_time_list = [obj.checkin_time for obj in attendance_detail_obj_out] - # 最早 时间 - max_time = max(checkin_time_list) - # 如果上班没有打卡 - if not attendance_obj.check_in: - # attendance_obj.sudo().write({ - # "sch_check_in_time": planning_id.start_datetime, - # "check_in": max_time, - # "is_late_card": max_time > planning_id.start_datetime, - # "is_no_card": True, - # "is_abnormal": True, - # }) - - if will_datetime_start + timedelta(minutes=10) > max_time > will_datetime_start: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": max_time, - "is_late_card": False, - "is_no_card": True, - "is_abnormal": True, - "absenteeism_card": True, - }) - elif will_datetime_start + timedelta(hours=1) > max_time > will_datetime_start: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": max_time, - "is_late_card": True, - "is_no_card": True, - "is_abnormal": True, - "absenteeism_card": True, - }) - elif max_time > will_datetime_start + timedelta(hours=1) and max_time > will_datetime_start: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": max_time, - "is_late_card": False, - "is_no_card": True, - "is_abnormal": True, - "absenteeism_card": True, - }) - else: - attendance_obj.sudo().write({ - "sch_check_in_time": will_datetime_start, - "check_in": max_time, - "is_late_card": max_time > will_datetime_start, - "is_no_card": True, - "is_abnormal": True, - "absenteeism_card": True, - }) - # 如果上班时间早于下班时间说明下班的卡没打 - elif attendance_obj.check_in >= max_time: + if not checkin_time_list: attendance_obj.sudo().write({"is_no_card": True, "is_abnormal": True}) else: - # attendance_obj.sudo().write({ - # "sch_check_out_time": planning_id.end_datetime, - # "check_out": max_time, - # "is_early_card": max_time < planning_id.end_datetime, - # "is_no_card": False, - # "is_abnormal": False, - # }) - if will_datetime_end - timedelta(minutes=10) < max_time < will_datetime_end: - attendance_obj.sudo().write({ - "sch_check_out_time": will_datetime_end, - "check_out": max_time, - "is_early_card": False, - "is_no_card": False, - "is_abnormal": True, - # "absenteeism_card": False, - }) - elif will_datetime_end - timedelta(hours=1) < max_time < will_datetime_end: - attendance_obj.sudo().write({ - "sch_check_out_time": will_datetime_end, - "check_out": max_time, - "is_early_card": True, - "is_no_card": False, - # "is_abnormal": False, - # "absenteeism_card": False, - }) - elif max_time < will_datetime_end - timedelta(hours=1): - attendance_obj.sudo().write({ - "sch_check_out_time": will_datetime_end, - "check_out": max_time, - "is_early_card": False, - "is_no_card": False, - # "is_abnormal": False, - "absenteeism_card": True, - }) + # 最早 时间 + max_time = max(checkin_time_list) + # 如果上班没有打卡 + if not attendance_obj.check_in: + # attendance_obj.sudo().write({ + # "sch_check_in_time": planning_id.start_datetime, + # "check_in": max_time, + # "is_late_card": max_time > planning_id.start_datetime, + # "is_no_card": True, + # "is_abnormal": True, + # }) + + if will_datetime_start + timedelta(minutes=10) > max_time > will_datetime_start: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": max_time, + "is_late_card": False, + "is_no_card": True, + "is_abnormal": True, + "absenteeism_card": True, + }) + elif will_datetime_start + timedelta(hours=1) > max_time > will_datetime_start: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": max_time, + "is_late_card": True, + "is_no_card": True, + "is_abnormal": True, + "absenteeism_card": True, + }) + elif max_time > will_datetime_start + timedelta(hours=1) and max_time > will_datetime_start: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": max_time, + "is_late_card": False, + "is_no_card": True, + "is_abnormal": True, + "absenteeism_card": True, + }) + else: + attendance_obj.sudo().write({ + "sch_check_in_time": will_datetime_start, + "check_in": max_time, + "is_late_card": max_time > will_datetime_start, + "is_no_card": True, + "is_abnormal": True, + "absenteeism_card": True, + }) + # 如果上班时间早于下班时间说明下班的卡没打 + elif attendance_obj.check_in >= max_time: + attendance_obj.sudo().write({"is_no_card": True, "is_abnormal": True}) else: - attendance_obj.sudo().write({ - "sch_check_out_time": will_datetime_end, - "check_out": max_time, - "is_early_card": max_time < will_datetime_end, - "is_no_card": False, - # "is_abnormal": False, - # "absenteeism_card": False, - }) + # attendance_obj.sudo().write({ + # "sch_check_out_time": planning_id.end_datetime, + # "check_out": max_time, + # "is_early_card": max_time < planning_id.end_datetime, + # "is_no_card": False, + # "is_abnormal": False, + # }) + if will_datetime_end - timedelta(minutes=10) < max_time < will_datetime_end: + attendance_obj.sudo().write({ + "sch_check_out_time": will_datetime_end, + "check_out": max_time, + "is_early_card": False, + "is_no_card": False, + "is_abnormal": True, + # "absenteeism_card": False, + }) + elif will_datetime_end - timedelta(hours=1) < max_time < will_datetime_end: + attendance_obj.sudo().write({ + "sch_check_out_time": will_datetime_end, + "check_out": max_time, + "is_early_card": True, + "is_no_card": False, + # "is_abnormal": False, + # "absenteeism_card": False, + }) + elif max_time < will_datetime_end - timedelta(hours=1): + attendance_obj.sudo().write({ + "sch_check_out_time": will_datetime_end, + "check_out": max_time, + "is_early_card": False, + "is_no_card": False, + # "is_abnormal": False, + "absenteeism_card": True, + }) + else: + attendance_obj.sudo().write({ + "sch_check_out_time": will_datetime_end, + "check_out": max_time, + "is_early_card": max_time < will_datetime_end, + "is_no_card": False, + # "is_abnormal": False, + # "absenteeism_card": False, + }) return True @staticmethod From c4724b8cccbdd1d1f2ad1287424739caf6450a03 Mon Sep 17 00:00:00 2001 From: ljmwkx <1340053001@qq.com> Date: Sun, 2 Mar 2025 10:25:23 +0800 Subject: [PATCH 2/3] 1 --- soong_workflow/wizard/soong_workflow_comment_wizard.py | 4 ++++ soong_workflow/wizard/soong_workflow_comment_wizard_view.xml | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py index 2528be53d..c251af2eb 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard.py +++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py @@ -27,6 +27,8 @@ class SoongWorkflowCommentWizard(models.TransientModel): trans_link_id = fields.Many2one('trans.link', string='转交节点') return_link_id = fields.Many2one('trans.link', string='退回节点') + employee_trans_domain_ids = fields.Many2many('hr.employee', 'employee_trans_domain_ids_rel', string="传阅人员", store=True) + employee_ids = fields.Many2many('hr.employee', 'employee_ids_rel', 'custom_id', 'employee_id', string="传阅人员", store=True) @@ -89,7 +91,9 @@ class SoongWorkflowCommentWizard(models.TransientModel): ['|', ('user_role_id', '=', link_users_id.id), ('user_role_ids', 'in', link_users_id.id), '|', ('department_id', '=', record_id.department_id.id), ('department_ids', 'in', record_id.department_id.id), ('yuthon_company', '=', record_id.create_uid.employee_id.yuthon_company)]) + self.employee_trans_domain_ids = employee_user_role_ids if not next_is_automatic else employee_user_role_id self.employee_ids = employee_user_role_ids if not next_is_automatic else employee_user_role_id + if self.node_btn_name == '退回': next_list = [] self_state = state_list.index(ret.name) diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard_view.xml b/soong_workflow/wizard/soong_workflow_comment_wizard_view.xml index 766ab57f9..df86c3ecd 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard_view.xml +++ b/soong_workflow/wizard/soong_workflow_comment_wizard_view.xml @@ -20,7 +20,8 @@ - + + From 3f4d9db4f4887e9864fb419f4759e070d8c95e99 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Sun, 2 Mar 2025 13:36:18 +0800 Subject: [PATCH 3/3] =?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 --- .../models/soong_workflow_record.py | 1 + .../views/soong_workflow_record.xml | 7 +- .../views/yuthon_fixes_approval_views.xml | 13 ++-- yuthon_hr_attendance/views/duty_approval.xml | 11 +-- yuthon_hr_attendance/views/go_approval.xml | 11 +-- .../views/overtime_approval.xml | 11 +-- .../views/remove_holiday_approval.xml | 11 +-- .../views/yuthon_abnormal_approval_views.xml | 15 ++-- .../yuthon_adjustments_approval_views.xml | 11 +-- .../views/yuthon_customer_approval_views.xml | 11 +-- .../views/yuthon_shift_approval_views.xml | 11 +-- .../views/yuthon_special_approval_views.xml | 11 +-- .../yuthon_appointment_approval_views.xml | 15 ++-- .../views/yuthon_interview_approval_views.xml | 10 ++- .../views/yuthon_message_login_views.xml | 12 ++-- .../views/yuthon_onboard_approval_views.xml | 11 +-- .../views/yuthon_prepare_approval_views.xml | 11 +-- .../yuthon_reassignment_approval_views.xml | 11 +-- .../yuthon_recruitment_approval_views.xml | 11 +-- .../yuthon_regularization_approval_views.xml | 11 +-- .../views/yuthon_reward_approval_views.xml | 14 ++-- .../views/yuthon_service_approval_views.xml | 11 +-- .../views/yuthon_transfer_approval_views.xml | 11 +-- yuthon_notice/models/yuthon_notice.py | 71 ++++++------------- .../models/yuthon_offficial_incoming_party.py | 7 +- yuthon_official/models/yuthon_official.py | 7 +- .../models/yuthon_official_incoming_labor.py | 6 +- .../models/yuthon_official_incoming_normal.py | 6 +- .../models/yuthon_official_labor.py | 6 ++ .../models/yuthon_official_party.py | 6 +- .../yuthon_official_incoming_labor_views.xml | 30 ++++++-- .../yuthon_official_incoming_normal_views.xml | 24 +++++-- .../yuthon_official_incoming_party_views.xml | 24 +++++-- .../views/yuthon_official_labor_views.xml | 27 +++---- .../views/yuthon_official_party_views.xml | 19 +++-- .../views/yuthon_official_views.xml | 20 ++++-- .../models/property_transfer_approval.py | 1 - .../views/property_approval_views.xml | 11 +-- .../views/property_early_quitting.xml | 11 +-- .../views/property_eligibility.xml | 11 +-- .../property_evaluate_application_views.xml | 16 ++++- .../views/property_handover_views.xml | 11 +-- .../views/property_intention_views.xml | 11 +-- .../views/property_lease_extension.xml | 11 +-- .../views/property_merge_approval_views.xml | 14 ++-- .../views/property_offline_registration.xml | 14 ++-- .../views/property_penalty_relief.xml | 11 +-- .../views/property_record_views.xml | 11 +-- .../views/property_rent_relief.xml | 11 +-- .../views/property_rental_conditions.xml | 14 ++-- .../views/property_rental_form_views.xml | 14 ++-- .../views/property_split_approval_views.xml | 14 ++-- .../views/property_transaction_confirmed.xml | 11 +-- .../views/property_transfer_views.xml | 29 +++++++- 54 files changed, 462 insertions(+), 269 deletions(-) diff --git a/soong_workflow/models/soong_workflow_record.py b/soong_workflow/models/soong_workflow_record.py index c02e5d417..ccc98614a 100644 --- a/soong_workflow/models/soong_workflow_record.py +++ b/soong_workflow/models/soong_workflow_record.py @@ -140,3 +140,4 @@ class SoongWorkflowRecord(models.Model): "name": self.name, "view_mode": "form", } + diff --git a/soong_workflow/views/soong_workflow_record.xml b/soong_workflow/views/soong_workflow_record.xml index 0e737cfd6..7550270c0 100644 --- a/soong_workflow/views/soong_workflow_record.xml +++ b/soong_workflow/views/soong_workflow_record.xml @@ -41,7 +41,7 @@ soong.workflow.record.kanban soong.workflow.record - +
@@ -64,6 +64,11 @@
+
+ +
diff --git a/yuthon_holiday/views/yuthon_fixes_approval_views.xml b/yuthon_holiday/views/yuthon_fixes_approval_views.xml index f64c1f52f..9b7301ac9 100644 --- a/yuthon_holiday/views/yuthon_fixes_approval_views.xml +++ b/yuthon_holiday/views/yuthon_fixes_approval_views.xml @@ -24,15 +24,20 @@ invisible="urgency_level != 'urgent'"/> - + - - + + + + + + +

@@ -53,8 +58,6 @@ - - diff --git a/yuthon_hr_attendance/views/duty_approval.xml b/yuthon_hr_attendance/views/duty_approval.xml index 4831a5ae5..86cc57893 100644 --- a/yuthon_hr_attendance/views/duty_approval.xml +++ b/yuthon_hr_attendance/views/duty_approval.xml @@ -23,14 +23,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -52,8 +57,6 @@ - - diff --git a/yuthon_hr_attendance/views/go_approval.xml b/yuthon_hr_attendance/views/go_approval.xml index 8bc07855e..29e3c4e22 100644 --- a/yuthon_hr_attendance/views/go_approval.xml +++ b/yuthon_hr_attendance/views/go_approval.xml @@ -24,14 +24,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -53,9 +58,7 @@ - - diff --git a/yuthon_hr_attendance/views/overtime_approval.xml b/yuthon_hr_attendance/views/overtime_approval.xml index 3433c9da7..4ffa86a2c 100644 --- a/yuthon_hr_attendance/views/overtime_approval.xml +++ b/yuthon_hr_attendance/views/overtime_approval.xml @@ -27,14 +27,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -51,8 +56,6 @@ - - diff --git a/yuthon_hr_attendance/views/remove_holiday_approval.xml b/yuthon_hr_attendance/views/remove_holiday_approval.xml index 038eed449..09b719d01 100644 --- a/yuthon_hr_attendance/views/remove_holiday_approval.xml +++ b/yuthon_hr_attendance/views/remove_holiday_approval.xml @@ -27,14 +27,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -56,8 +61,6 @@ - - diff --git a/yuthon_hr_attendance/views/yuthon_abnormal_approval_views.xml b/yuthon_hr_attendance/views/yuthon_abnormal_approval_views.xml index 4c9508928..5877e99ed 100644 --- a/yuthon_hr_attendance/views/yuthon_abnormal_approval_views.xml +++ b/yuthon_hr_attendance/views/yuthon_abnormal_approval_views.xml @@ -24,14 +24,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -45,13 +50,9 @@ - + - - - - diff --git a/yuthon_hr_attendance/views/yuthon_adjustments_approval_views.xml b/yuthon_hr_attendance/views/yuthon_adjustments_approval_views.xml index 72c71107f..c9b1ebb25 100644 --- a/yuthon_hr_attendance/views/yuthon_adjustments_approval_views.xml +++ b/yuthon_hr_attendance/views/yuthon_adjustments_approval_views.xml @@ -24,14 +24,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -49,8 +54,6 @@ - - diff --git a/yuthon_hr_attendance/views/yuthon_customer_approval_views.xml b/yuthon_hr_attendance/views/yuthon_customer_approval_views.xml index eed373301..023d64c18 100644 --- a/yuthon_hr_attendance/views/yuthon_customer_approval_views.xml +++ b/yuthon_hr_attendance/views/yuthon_customer_approval_views.xml @@ -22,14 +22,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -45,8 +50,6 @@ - - diff --git a/yuthon_hr_attendance/views/yuthon_shift_approval_views.xml b/yuthon_hr_attendance/views/yuthon_shift_approval_views.xml index bc2a626b8..a31d905ca 100644 --- a/yuthon_hr_attendance/views/yuthon_shift_approval_views.xml +++ b/yuthon_hr_attendance/views/yuthon_shift_approval_views.xml @@ -27,14 +27,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -55,8 +60,6 @@ - - diff --git a/yuthon_hr_attendance/views/yuthon_special_approval_views.xml b/yuthon_hr_attendance/views/yuthon_special_approval_views.xml index 1a165545b..17759acc0 100644 --- a/yuthon_hr_attendance/views/yuthon_special_approval_views.xml +++ b/yuthon_hr_attendance/views/yuthon_special_approval_views.xml @@ -27,14 +27,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -52,8 +57,6 @@ - - diff --git a/yuthon_hr_employee_approval/views/yuthon_appointment_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_appointment_approval_views.xml index 2dec59c23..9a8a2f1af 100644 --- a/yuthon_hr_employee_approval/views/yuthon_appointment_approval_views.xml +++ b/yuthon_hr_employee_approval/views/yuthon_appointment_approval_views.xml @@ -26,14 +26,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -47,13 +52,9 @@ - + - - - - diff --git a/yuthon_hr_employee_approval/views/yuthon_interview_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_interview_approval_views.xml index 64d7cfb0d..7127b3333 100644 --- a/yuthon_hr_employee_approval/views/yuthon_interview_approval_views.xml +++ b/yuthon_hr_employee_approval/views/yuthon_interview_approval_views.xml @@ -28,14 +28,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -50,7 +55,6 @@ - diff --git a/yuthon_hr_employee_approval/views/yuthon_message_login_views.xml b/yuthon_hr_employee_approval/views/yuthon_message_login_views.xml index baa011320..f251fbe3b 100644 --- a/yuthon_hr_employee_approval/views/yuthon_message_login_views.xml +++ b/yuthon_hr_employee_approval/views/yuthon_message_login_views.xml @@ -26,14 +26,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -81,9 +86,6 @@
- - - diff --git a/yuthon_hr_employee_approval/views/yuthon_onboard_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_onboard_approval_views.xml index fe1b491b1..271737559 100644 --- a/yuthon_hr_employee_approval/views/yuthon_onboard_approval_views.xml +++ b/yuthon_hr_employee_approval/views/yuthon_onboard_approval_views.xml @@ -27,14 +27,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -49,8 +54,6 @@ - - diff --git a/yuthon_hr_employee_approval/views/yuthon_prepare_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_prepare_approval_views.xml index 2748fb495..c9dc0dfbe 100644 --- a/yuthon_hr_employee_approval/views/yuthon_prepare_approval_views.xml +++ b/yuthon_hr_employee_approval/views/yuthon_prepare_approval_views.xml @@ -23,14 +23,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -49,8 +54,6 @@ - - diff --git a/yuthon_hr_employee_approval/views/yuthon_reassignment_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_reassignment_approval_views.xml index 336f3ba84..0df34447b 100644 --- a/yuthon_hr_employee_approval/views/yuthon_reassignment_approval_views.xml +++ b/yuthon_hr_employee_approval/views/yuthon_reassignment_approval_views.xml @@ -28,14 +28,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -90,8 +95,6 @@ - - diff --git a/yuthon_hr_employee_approval/views/yuthon_recruitment_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_recruitment_approval_views.xml index 847754a84..11c124c24 100644 --- a/yuthon_hr_employee_approval/views/yuthon_recruitment_approval_views.xml +++ b/yuthon_hr_employee_approval/views/yuthon_recruitment_approval_views.xml @@ -23,14 +23,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -41,8 +46,6 @@ - - diff --git a/yuthon_hr_employee_approval/views/yuthon_regularization_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_regularization_approval_views.xml index 7eb432fae..6bb40b6cb 100644 --- a/yuthon_hr_employee_approval/views/yuthon_regularization_approval_views.xml +++ b/yuthon_hr_employee_approval/views/yuthon_regularization_approval_views.xml @@ -30,14 +30,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -79,8 +84,6 @@ - - diff --git a/yuthon_hr_employee_approval/views/yuthon_reward_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_reward_approval_views.xml index 55a6bd95a..a0d5a8eb2 100644 --- a/yuthon_hr_employee_approval/views/yuthon_reward_approval_views.xml +++ b/yuthon_hr_employee_approval/views/yuthon_reward_approval_views.xml @@ -26,14 +26,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -55,8 +60,6 @@ - - @@ -75,9 +78,6 @@ - - - diff --git a/yuthon_hr_employee_approval/views/yuthon_service_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_service_approval_views.xml index cd5629c88..389203402 100644 --- a/yuthon_hr_employee_approval/views/yuthon_service_approval_views.xml +++ b/yuthon_hr_employee_approval/views/yuthon_service_approval_views.xml @@ -25,14 +25,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -52,8 +57,6 @@ - - diff --git a/yuthon_hr_employee_approval/views/yuthon_transfer_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_transfer_approval_views.xml index bd4b825b8..e915aa776 100644 --- a/yuthon_hr_employee_approval/views/yuthon_transfer_approval_views.xml +++ b/yuthon_hr_employee_approval/views/yuthon_transfer_approval_views.xml @@ -27,14 +27,19 @@ invisible="urgency_level != 'urgent'"/> - + - + + + + + +

@@ -46,8 +51,6 @@ - - diff --git a/yuthon_notice/models/yuthon_notice.py b/yuthon_notice/models/yuthon_notice.py index 8896842e3..832af6118 100644 --- a/yuthon_notice/models/yuthon_notice.py +++ b/yuthon_notice/models/yuthon_notice.py @@ -50,11 +50,23 @@ class YuthonNotice(models.Model): name_title = fields.Char(default=_get_default_name_title) - # @api.onchange('employee_ids', 'department_ids', 'users_role_ids') - # def onchange_employee_ids(self): - # for notice in self: - # users = notice.employee_ids.mapped('user_id') + notice.users_role_ids.mapped('user_id') + notice.department_ids.mapped('user_id') - # notice.users_ids = users + @api.onchange('employee_ids', 'department_ids', 'users_role_ids') + def onchange_employee_ids(self): + def get_department_employees(department_id): + valid_user_ids = set() + employee_ids = self.env['hr.employee'].search([('department_id', '=', department_id.id)]) + valid_user_ids.update([user.user_id.id for user in employee_ids if user.user_id]) + child_ids = self.env['hr.department'].search([('parent_id', '=', department_id.id)]) + for child in child_ids: + valid_user_ids.update(get_department_employees(child)) + return valid_user_ids + department_user_ids = set() + for department_id in self.department_ids: + department_user_ids.update(get_department_employees(department_id)) + + for notice in self: + users = notice.employee_ids.mapped('user_id') + notice.users_role_ids.mapped('user_id') + department_user_ids + notice.users_ids = users def get_no_read_count(self): return self.search_count([('is_notice_roger', '=', 'no'), ('notice_state', '=', 'yes')]) @@ -91,12 +103,12 @@ class YuthonNotice(models.Model): def no_sequence(self): self.sequence = 0 - def notice_publish(self, valid_employee_ids): + def notice_publish(self): if self.is_change_notice: menu_id = self.env['ir.ui.menu'].search([('name', '=', '通知公告'), ('parent_id', '!=', False)]) str = 'https://oa.thtzjt.com/web#id={}&cids=1&menu_id={}&action={}&model=yuthon.notice&view_type=form'.format(self.id, menu_id.id, menu_id.action.id) - conf_old = self.env['yuthon.confirm.users'].search([('notice_id', '=', self.id), ('employee_id', 'in', list(valid_employee_ids))]) - for employee_id in valid_employee_ids: + conf_old = self.env['yuthon.confirm.users'].search([('notice_id', '=', self.id), ('employee_id', 'in', self.users_ids.ids)]) + for employee_id in self.users_ids: if conf_old: for co in conf_old: co.write({'state': 'no'}) @@ -142,46 +154,3 @@ class YuthonNotice(models.Model): 'notice_state': 'stop', 'end_date': fields.Date.today(), }) - - def notice_users_publish(self): - # 获取 self.employee_ids 中的用户 - employee_user_ids = {user.user_id.id for user in self.employee_ids if user.user_id} - - # 获取部门用户 - def get_department_employees(department_id): - valid_user_ids = set() - employee_ids = self.env['hr.employee'].search([('department_id', '=', department_id.id)]) - valid_user_ids.update([user.user_id.id for user in employee_ids if user.user_id]) - child_ids = self.env['hr.department'].search([('parent_id', '=', department_id.id)]) - for child in child_ids: - valid_user_ids.update(get_department_employees(child)) - return valid_user_ids - department_user_ids = set() - for department_id in self.department_ids: - department_user_ids.update(get_department_employees(department_id)) - - # 获取 user_role_ids 中的用户 - role_user_ids = set() - for user_role in self.users_role_ids: - user_employee_ids = self.env['hr.employee'].search( - ['|', ('user_role_id', '=', user_role.id), ('user_role_ids', 'in', [user_role.id])]) - role_user_ids.update([user.user_id.id for user in user_employee_ids if user.user_id]) - # 取三个ids的用户交集 - valid_user_ids = employee_user_ids | department_user_ids | role_user_ids - # 查询所有符合条件的 hr.employee 记录 - valid_employees = self.env['hr.employee'].search([('user_id', 'in', list(valid_user_ids))]) - # 提取 employee_id - valid_employee_ids = {employee.id for employee in valid_employees} - self.notice_publish(valid_employee_ids) - - @api.model - def action_create_notice_form1(self): - return { - 'name': '创建通知公告', - 'type': 'ir.actions.act_window', - 'res_model': 'yuthon.notice', - 'view_mode': 'form', - 'view_id': self.env.ref('yuthon_notice.view_yuthon_notice_form').id, - 'target': 'current', - 'context': {}, - } \ No newline at end of file diff --git a/yuthon_official/models/yuthon_offficial_incoming_party.py b/yuthon_official/models/yuthon_offficial_incoming_party.py index e21756574..8d5f35958 100644 --- a/yuthon_official/models/yuthon_offficial_incoming_party.py +++ b/yuthon_official/models/yuthon_offficial_incoming_party.py @@ -23,7 +23,7 @@ class YuthonOfficialIncomingParty(models.Model): main_flats = fields.Char(string="主送") copy_flats = fields.Char(string="抄送") servings_number = fields.Integer(string="份数") - urgency = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度") + urgency_level = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度") secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')], string="密级") date = fields.Datetime(string="日期", default=fields.Datetime.now) @@ -35,6 +35,11 @@ class YuthonOfficialIncomingParty(models.Model): official_documents_ids = fields.Many2many('ir.attachment', string="附件") is_issues = fields.Boolean(string="是否上会") related_issues_id = fields.Many2one('issue.library', string="关联议题") + def _get_default_name_title(self): + return self._description if self._description else self._name + + name_title = fields.Char(default=_get_default_name_title) + active = fields.Boolean('Active', default=True, tracking=True) @api.onchange('is_issues') diff --git a/yuthon_official/models/yuthon_official.py b/yuthon_official/models/yuthon_official.py index 662dd9301..c9b1c5bca 100644 --- a/yuthon_official/models/yuthon_official.py +++ b/yuthon_official/models/yuthon_official.py @@ -25,7 +25,7 @@ class YuthonOfficial(models.Model): employee_ids = fields.Many2many('hr.employee', string='人员范围') users_role_ids = fields.Many2many('soong.user.role', string='角色范围') servings_number = fields.Integer(string="份数") - urgency = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度") + urgency_level = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度") secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')], string="密级") date = fields.Datetime(string="日期", default=fields.Datetime.now) department_id = fields.Many2one('hr.department', string="申请人部门") @@ -44,6 +44,11 @@ class YuthonOfficial(models.Model): workflow_inspector_ids = fields.One2many('soong.workflow.inspector', 'yuthon_official_id', string="督办事项") room_booking_ids = fields.One2many('room.booking', 'yuthon_official_id', string="会议关联") issue_library_ids = fields.One2many('issue.library', 'yuthon_official_id', string="议题关联") + def _get_default_name_title(self): + return self._description if self._description else self._name + + name_title = fields.Char(default=_get_default_name_title) + def supervising_button(self): return { diff --git a/yuthon_official/models/yuthon_official_incoming_labor.py b/yuthon_official/models/yuthon_official_incoming_labor.py index 31ff868d6..1f46fd75c 100644 --- a/yuthon_official/models/yuthon_official_incoming_labor.py +++ b/yuthon_official/models/yuthon_official_incoming_labor.py @@ -23,7 +23,7 @@ class YuthonOfficialIncomingLabor(models.Model): main_flats = fields.Char(string="主送") copy_flats = fields.Char(string="抄送") servings_number = fields.Integer(string="份数") - urgency = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度") + urgency_level = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度") secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')], string="密级") date = fields.Datetime(string="日期", default=fields.Datetime.now) @@ -36,6 +36,10 @@ class YuthonOfficialIncomingLabor(models.Model): is_issues = fields.Boolean(string="是否上会") related_issues_id = fields.Many2one('issue.library', string="关联议题") active = fields.Boolean('Active', default=True, tracking=True) + def _get_default_name_title(self): + return self._description if self._description else self._name + + name_title = fields.Char(default=_get_default_name_title) @api.onchange('is_issues') def _onchange_is_issues(self): diff --git a/yuthon_official/models/yuthon_official_incoming_normal.py b/yuthon_official/models/yuthon_official_incoming_normal.py index 5759552ff..82d95c292 100644 --- a/yuthon_official/models/yuthon_official_incoming_normal.py +++ b/yuthon_official/models/yuthon_official_incoming_normal.py @@ -23,7 +23,7 @@ class YuthonOfficialIncomingNormal(models.Model): incoming_file_id = fields.Char(string="收文编号") main_flats = fields.Char(string="主送") servings_number = fields.Integer(string="份数") - urgency = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度") + urgency_level = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度") secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')], string="密级") time_date = fields.Datetime(string="日期", default=fields.Datetime.now) users_id = fields.Many2one('res.users', string="拟办人", default=lambda self: self.env.user.id) @@ -44,6 +44,10 @@ class YuthonOfficialIncomingNormal(models.Model): room_booking_ids = fields.One2many('room.booking', 'incoming_normal_id', string="会议关联") issue_library_ids = fields.One2many('issue.library', 'incoming_normal_id', string="议题关联") related_issues_id = fields.Many2one('issue.library', string="关联议题") + def _get_default_name_title(self): + return self._description if self._description else self._name + + name_title = fields.Char(default=_get_default_name_title) @api.onchange('is_issues') def _onchange_is_issues(self): diff --git a/yuthon_official/models/yuthon_official_labor.py b/yuthon_official/models/yuthon_official_labor.py index 5ae8fcecc..a2078168b 100644 --- a/yuthon_official/models/yuthon_official_labor.py +++ b/yuthon_official/models/yuthon_official_labor.py @@ -26,4 +26,10 @@ class YuthonOfficialLabor(models.Model): deadline = fields.Date(string="办理期限") red_suit = fields.Char(string="套红") official_documents_ids = fields.Many2many('ir.attachment', string="附件") + urgency_level = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], + string="紧急程度") active = fields.Boolean('Active', default=True, tracking=True) + def _get_default_name_title(self): + return self._description if self._description else self._name + + name_title = fields.Char(default=_get_default_name_title) \ No newline at end of file diff --git a/yuthon_official/models/yuthon_official_party.py b/yuthon_official/models/yuthon_official_party.py index ea0119d71..a790fc79a 100644 --- a/yuthon_official/models/yuthon_official_party.py +++ b/yuthon_official/models/yuthon_official_party.py @@ -23,7 +23,7 @@ class YuthonOfficialParty(models.Model): main_flats = fields.Char(string="主送") copy_flats = fields.Char(string="抄送") servings_number = fields.Integer(string="份数") - urgency = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度") + urgency_level = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度") secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')], string="密级") date = fields.Datetime(string="日期", default=fields.Datetime.now) @@ -34,3 +34,7 @@ class YuthonOfficialParty(models.Model): red_suit = fields.Char(string="套红") official_documents_ids = fields.Many2many('documents.document', string="公文相关文件") active = fields.Boolean('Active', default=True, tracking=True) + def _get_default_name_title(self): + return self._description if self._description else self._name + + name_title = fields.Char(default=_get_default_name_title) diff --git a/yuthon_official/views/yuthon_official_incoming_labor_views.xml b/yuthon_official/views/yuthon_official_incoming_labor_views.xml index fe51d6829..179d3ebee 100644 --- a/yuthon_official/views/yuthon_official_incoming_labor_views.xml +++ b/yuthon_official/views/yuthon_official_incoming_labor_views.xml @@ -22,9 +22,32 @@ - - + + + + + + + + + + + +
+

+ +

+
+
+
@@ -34,10 +57,7 @@ - - - diff --git a/yuthon_official/views/yuthon_official_incoming_normal_views.xml b/yuthon_official/views/yuthon_official_incoming_normal_views.xml index fe40f5e14..b34347045 100644 --- a/yuthon_official/views/yuthon_official_incoming_normal_views.xml +++ b/yuthon_official/views/yuthon_official_incoming_normal_views.xml @@ -17,8 +17,25 @@
- - + + + + + + + + + + + + + + + + @@ -28,11 +45,8 @@ - - - diff --git a/yuthon_official/views/yuthon_official_incoming_party_views.xml b/yuthon_official/views/yuthon_official_incoming_party_views.xml index 88dbecacc..488899afc 100644 --- a/yuthon_official/views/yuthon_official_incoming_party_views.xml +++ b/yuthon_official/views/yuthon_official_incoming_party_views.xml @@ -21,9 +21,26 @@ - - + + + + + + + + + + + +
+

+ +

+
@@ -33,10 +50,7 @@ - - - diff --git a/yuthon_official/views/yuthon_official_labor_views.xml b/yuthon_official/views/yuthon_official_labor_views.xml index 7d5da38e2..0468f2114 100644 --- a/yuthon_official/views/yuthon_official_labor_views.xml +++ b/yuthon_official/views/yuthon_official_labor_views.xml @@ -18,19 +18,22 @@ yuthon.official.labor -
- -
- - - -
-
+ + + + + + + + + + + + diff --git a/yuthon_official/views/yuthon_official_party_views.xml b/yuthon_official/views/yuthon_official_party_views.xml index c55c91cf3..df1be0738 100644 --- a/yuthon_official/views/yuthon_official_party_views.xml +++ b/yuthon_official/views/yuthon_official_party_views.xml @@ -21,10 +21,22 @@
- - - + + + + + + + + + + + +