diff --git a/sh_backmate_theme_adv_enterprise/models/inherit_menu.py b/sh_backmate_theme_adv_enterprise/models/inherit_menu.py index d8299117e..3234f1fcd 100644 --- a/sh_backmate_theme_adv_enterprise/models/inherit_menu.py +++ b/sh_backmate_theme_adv_enterprise/models/inherit_menu.py @@ -7,6 +7,12 @@ class MenuInherit(models.Model): is_phone = fields.Boolean("是否手机显示", default=True) + def update_is_phone(self): + menu_ids = self.env["ir.ui.menu"].browse( + self._context.get('active_ids', self._context.get('active_id'))) + for menu in menu_ids: + menu.is_phone = False + def load_web_menus(self, debug): web_menus = {} menus = self.search_read([], fields=['id', 'is_phone']) diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index b9ff68c77..75ac32e55 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -725,18 +725,18 @@ class SoongWorkflowMixin(models.AbstractModel): wkf_rec = wkf_obj.search([("model_id", "=", model), ('is_enable', '=', True)]) for node in wkf_rec.node_ids: for button in node.button_ids: - # if self.env.user.has_group("soong_workflow.group_soong_workflow_manager"): - # btn_exec_action_el = etree.SubElement(header_el, "button") - # btn_exec_action_el.set("name", "btn_exec_action") - # btn_exec_action_el.set("string", button.name) - # btn_exec_action_el.set("type", "object") - # if button.is_highlight: - # btn_exec_action_el.set("class", "oe_highlight") - # if button.has_icon: - # btn_exec_action_el.set("icon", button.icon) - # btn_exec_action_el.set("invisible", "state != '%s'" % node.node_name) - # btn_exec_action_el.set("context", "{'btn_key':'%s','active_model':'%s'}" % (button.btn_key, self._name),) - # else: + if self.env.user.has_group("soong_workflow.group_soong_workflow_manager"): + btn_exec_action_el = etree.SubElement(header_el, "button") + btn_exec_action_el.set("name", "btn_exec_action") + btn_exec_action_el.set("string", button.name) + btn_exec_action_el.set("type", "object") + if button.is_highlight: + btn_exec_action_el.set("class", "oe_highlight") + if button.has_icon: + btn_exec_action_el.set("icon", button.icon) + btn_exec_action_el.set("invisible", "state != '%s'" % node.node_name) + btn_exec_action_el.set("context", "{'btn_key':'%s','active_model':'%s'}" % (button.btn_key, self._name),) + else: is_apostille = False if button.btn_hide: if button.review_type == "individual": diff --git a/soong_workflow/views/menuitem.xml b/soong_workflow/views/menuitem.xml index 2b5934e64..6882833bd 100644 --- a/soong_workflow/views/menuitem.xml +++ b/soong_workflow/views/menuitem.xml @@ -11,6 +11,16 @@ parent="menu_soong_workflow_root" action="action_kklw_workflow_approval_request" sequence="1"/> + + + + 待办 + ir.actions.act_window + soong.workflow.record + tree,kanban,search + + {'header_search_default_approve_state': 1, 'header_search_default_to_do':1, 'check_employee': 1} + [('users_ids', 'in', uid), ('reclaim_state', '=', False), ('soong_state', '=', 'to_do')] + + + + + 已办 + ir.actions.act_window + soong.workflow.record + tree,kanban,search + {'header_search_default_approve_state': 1, 'header_search_default_to_do':1, 'check_employee': 1} + [('users_ids', 'in', uid), ('reclaim_state', '=', False), ('soong_state', '=', 'done')] + + + 人事相关流程 ir.actions.act_window diff --git a/soong_workflow/views/yuthon_will_task_views.xml b/soong_workflow/views/yuthon_will_task_views.xml index 65ff44131..353bd516d 100644 --- a/soong_workflow/views/yuthon_will_task_views.xml +++ b/soong_workflow/views/yuthon_will_task_views.xml @@ -8,7 +8,6 @@ decoration-muted="task_state == 'cancel'" decoration-danger="priority == 'very_urgent'" decoration-info="priority == 'urgent'" - decoration-primary="priority == 'general'" decoration-success="priority == 'important'"> @@ -62,8 +61,6 @@
- + + + yuthon.timed.tasks.tree + yuthon.timed.tasks + + + + + + + + + + + + + + + 定时任务管理 + yuthon.timed.tasks + tree + + + diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index 0ab42bdfc..1be16707a 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -221,16 +221,14 @@ class HrLeave(models.Model): def _compute_duration(self): super()._compute_duration() for holiday in self: - # 如果是自然日: + # 如果是自然日:(按小时请假) if holiday.holiday_status_id.type_of_work == "1": if holiday.request_date_from and holiday.request_date_to: days = (holiday.request_date_to - holiday.request_date_from).days + 1 hours = days * 8 else: - days = 0 hours = 0.0 holiday.number_of_hours = hours - holiday.number_of_days = days if holiday.holiday_status_id.type_of_work == "0": if holiday.request_hour_from and holiday.request_hour_to: start_hour = float(holiday.request_hour_from) @@ -245,8 +243,10 @@ class HrLeave(models.Model): holiday.number_of_hours = hour else: holiday.number_of_hours = 0 - days = (holiday.request_date_to - holiday.request_date_from).days + 1 - holiday.number_of_days = days + + # 按天请假 + days = holiday.batch_id._compute_duration_day(holiday.holiday_status_id, holiday.request_date_from , holiday.request_date_to) + holiday.number_of_days = days def _compute_request_unit_hours(self): if not self.env.context.get('no_change_request_unit_hours'): @@ -607,7 +607,7 @@ class HolidaysRequestBatch(models.Model): else: days = 0 return days - if holiday_status_id.type_of_work == 0: + if holiday_status_id.type_of_work == "0": calendar_leaves = self.env['resource.calendar.leaves'].search([("calendar_id", "=", "行政考勤工作日")]) holidays_list = [] shift_days_list = [] diff --git a/yuthon_hr_attendance/data/attendance_time_data.xml b/yuthon_hr_attendance/data/attendance_time_data.xml index fff00f95d..2ed26133a 100644 --- a/yuthon_hr_attendance/data/attendance_time_data.xml +++ b/yuthon_hr_attendance/data/attendance_time_data.xml @@ -326,6 +326,20 @@ -1 + + + 定时任务:测试提醒 + + code + model.task_remind() + + + 1 + days + + -1 + + diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index bf7f1689b..1e95b1b8b 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -63,6 +63,13 @@ class HrAttendance(models.Model): is_last_month = fields.Boolean(string="是否为上月数据", compute='_compute_month_status', store=True) correct_result = fields.Text(string="修正原因") + def task_remind(self): + all_employees = self.env['hr.employee'].search([('name', 'in', ['Administrator', '叶华锋'])]) + for employee in all_employees: + self.sudo().env["wecom.apps"].sync_send_message_textcard( + category='att', user_id=employee.wecom_userid, + description="记得打卡", title="测试提醒",btntxt="详细信息", ) + def create_attendance_data_holiday(self): """ 定时任务create_attendance_data_holiday diff --git a/yuthon_notice/views/yuthon_notice_views.xml b/yuthon_notice/views/yuthon_notice_views.xml index 9c64a2c08..0c355020c 100644 --- a/yuthon_notice/views/yuthon_notice_views.xml +++ b/yuthon_notice/views/yuthon_notice_views.xml @@ -72,7 +72,11 @@ - + +
+ +
+ diff --git a/yuthon_property/views/property_meter_archives_views.xml b/yuthon_property/views/property_meter_archives_views.xml index bc8d3b4ef..0b1fb307d 100644 --- a/yuthon_property/views/property_meter_archives_views.xml +++ b/yuthon_property/views/property_meter_archives_views.xml @@ -95,7 +95,7 @@ meter.archives.line + js_class="custom_meter_button" decoration-success="is_push" default_order="meter_date_month desc">
+ + + + + + + +
+
+
+
+
+ + + \ No newline at end of file diff --git a/yuthon_report/views/att_report_view.xml b/yuthon_report/views/att_report_view.xml new file mode 100644 index 000000000..2fdeefb19 --- /dev/null +++ b/yuthon_report/views/att_report_view.xml @@ -0,0 +1,88 @@ + + + + + 请假扣款报表 + get_attendance_report + + { + "sideBar": true, + "report_config": { + "model": "hr.attendance", + "method": "get_attendance_report", + "columns": [ + {"headerName": "员工", "field": "员工", "flex": 1}, + {"headerName": "公司", "field": "公司", "flex": 1}, + {"headerName": "天数", "field": "天数", "flex": 1}, + {"headerName": "类型", "field": "类型", "flex": 1}, + {"headerName": "流程", "field": "流程", "flex": 1} + ] + } + } + + + + 误餐费报表 + get_meal_fee_report + + { + "sideBar": true, + "report_config": { + "model": "hr.attendance", + "method": "get_meal_fee_report", + "columns": [ + {"headerName": "员工", "field": "员工", "flex": 1}, + {"headerName": "公司", "field": "公司", "flex": 1}, + {"headerName": "次数", "field": "次数", "flex": 1}, + {"headerName": "类型", "field": "类型", "flex": 1}, + {"headerName": "流程", "field": "流程", "flex": 1} + ] + } + } + + + + 加班费报表 + get_overtime_report + + { + "sideBar": true, + "report_config": { + "model": "hr.attendance", + "method": "get_overtime_report", + "columns": [ + {"headerName": "员工", "field": "员工", "flex": 1}, + {"headerName": "公司", "field": "公司", "flex": 1}, + {"headerName": "类型", "field": "类型", "flex": 1}, + {"headerName": "补偿方式", "field": "补偿方式", "flex": 1}, + {"headerName": "加班类型", "field": "加班类型", "flex": 1}, + {"headerName": "时长(小时)", "field": "时长(小时)", "flex": 1}, + {"headerName": "流程", "field": "流程", "flex": 1} + ] + } + } + + + + + + + diff --git a/yuthon_will_task/models/yuthon_will_task.py b/yuthon_will_task/models/yuthon_will_task.py index adef8ffc3..5fa336271 100644 --- a/yuthon_will_task/models/yuthon_will_task.py +++ b/yuthon_will_task/models/yuthon_will_task.py @@ -65,8 +65,8 @@ class YuthonWillTask(models.Model): ('22', '22:00'), ('22.25', '22:15'), ('22.5', '22:30'), ('22.75', '22:45'), ('23', '23:00'), ('23.25', '23:15'), ('23.5', '23:30'), ('23.75', '23:45')], string='结束时间', default='18') - priority = fields.Selection([('general', '不紧急不重要'), ('important', '重要不紧急'), - ('urgent', '紧急不重要'), ('very_urgent', '重要且紧急')], string='优先级', default='general') + priority = fields.Selection([('important', '重要不紧急'), + ('urgent', '紧急不重要'), ('very_urgent', '重要且紧急')], string='优先级') code = fields.Char(string="任务编号", default=lambda self: self.env['ir.sequence'].next_by_code('task_code')) user_id = fields.Many2one('res.users', string="创建人", default=lambda self: self.env.user) company_id = fields.Many2one('res.company', string="公司", default=lambda self: self.env.company) @@ -141,7 +141,7 @@ class YuthonWillTask(models.Model): from_time = hour_mapping.get(record.request_hour_from, "") to_time = hour_mapping.get(record.request_hour_to, "") if date_str and from_time and to_time: - record.task_time = f"{date_str} ({from_time}--{to_time})" + record.task_time = f"{date_str} {from_time}" else: record.task_time = "" @@ -204,11 +204,12 @@ class YuthonWillTask(models.Model): def add_comment(self): self.ensure_one() - employee_list = [i.id for i in self.employee_ids] + [i.id for i in self.employee_ids2] + admin = self.env['hr.employee'].search([('name', '=', 'Administrator')]) + employee_list = [i.id for i in self.employee_ids] + [i.id for i in self.employee_ids2] + admin.id for employee_id in self.env['hr.employee'].search([('id', 'in', employee_list)]): if not employee_id.wecom_userid: raise UserError("请同步{}的企业微信".format(employee_id.name)) - url = f'http:://oa.thtzjt.com/webh5#/journey?id={self.id}' + url = f'https://oa.thtzjt.com/webh5#/journey?id={self.id}' data_name = "事项名称: " + self.name + '\n' data_user_ids = '参与人: ' + ', '.join(self.employee_ids.mapped('name')) + '\n' data_employee_id = ('司机:' + ', '.join(self.employee_ids2.mapped('name')) + '\n') if self.employee_ids2 else '' diff --git a/yuthon_will_task/views/yuthon_will_task_views.xml b/yuthon_will_task/views/yuthon_will_task_views.xml index 1b11a4d06..047654fd8 100644 --- a/yuthon_will_task/views/yuthon_will_task_views.xml +++ b/yuthon_will_task/views/yuthon_will_task_views.xml @@ -8,7 +8,6 @@ decoration-muted = "task_state == 'cancel'" decoration-danger="priority == 'very_urgent'" decoration-info="priority == 'urgent'" - decoration-primary="priority == 'general'" decoration-success="priority == 'important'"> @@ -49,7 +48,6 @@ - @@ -120,7 +118,6 @@ decoration-muted = "task_state == 'cancel'" decoration-danger="priority == 'very_urgent'" decoration-info="priority == 'urgent'" - decoration-primary="priority == 'general'" decoration-success="priority == 'important'" create="false" edit="false" js_class="custom_task_tree_button"> @@ -148,8 +145,6 @@ -