梳理
This commit is contained in:
@@ -4,3 +4,6 @@ gtts
|
||||
jwt
|
||||
pypinyin
|
||||
mammoth
|
||||
|
||||
shapely
|
||||
geojson
|
||||
|
||||
@@ -13,10 +13,11 @@
|
||||
'sequence': 240,
|
||||
'website': 'https://www.pengyuthon.com',
|
||||
'depends': ['hr_attendance', 'resource', 'base', 'hr', 'mail',
|
||||
'soong_workflow', 'yuthon_issue', 'planning', 'calendar', 'web_gantt'],
|
||||
'soong_workflow', 'yuthon_issue', 'planning', 'calendar', 'web_gantt', 'yuthon_wechat'],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'security/attendance_security_group.xml',
|
||||
'data/hr_attendance_time.xml',
|
||||
'data/attendance_code_data.xml',
|
||||
'data/attendance_role_groups_data.xml',
|
||||
'data/attendance_time_data.xml',
|
||||
@@ -28,6 +29,8 @@
|
||||
'views/yuthon_customer_approval_views.xml',
|
||||
'views/yuthon_shift_planning_views.xml',
|
||||
'views/yuthon_run_planning_views.xml',
|
||||
'views/hr_attendance_wechat_views.xml',
|
||||
'views/hr_attendance_detail_wechat_views.xml',
|
||||
'views/overtime_approval.xml',
|
||||
'views/go_approval.xml',
|
||||
'views/leave_approval.xml',
|
||||
@@ -46,6 +49,7 @@
|
||||
'views/card_remind_form.xml',
|
||||
'views/yuthon_customer_planning_views.xml',
|
||||
'views/all_attendance_menu.xml',
|
||||
'views/planning_slot_template_views.xml',
|
||||
|
||||
],
|
||||
'assets': {
|
||||
|
||||
@@ -23,7 +23,8 @@ from . import yuthon_shift_approval
|
||||
from . import yuthon_special_approval
|
||||
from . import yuthon_customer_planning
|
||||
|
||||
|
||||
from . import hr_attendance_wechat
|
||||
from . import hr_attendance_detail_wechat
|
||||
|
||||
# from odoo.tools import SQL
|
||||
# import odoo
|
||||
|
||||
+16
-2
@@ -6,7 +6,6 @@ import logging
|
||||
import traceback
|
||||
from odoo import api, fields, models, tools, _
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from ...yuthon_wechat.utils.common import utils_list_page
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -543,7 +542,7 @@ class HrAttendanceDetail(models.Model):
|
||||
start_time = now_time - timedelta(days=30)
|
||||
|
||||
# 企业微信获取打卡数据,要求用户分组100,分批获取打卡记录
|
||||
for userid_limit in utils_list_page(user_list, 100):
|
||||
for userid_limit in self.utils_list_page(user_list, 100):
|
||||
# 获取企业微信的打卡信息
|
||||
try:
|
||||
attendance_data = self._get_wx_attendance_data(userid_limit, now_time, start_time)
|
||||
@@ -845,3 +844,18 @@ class HrAttendanceDetail(models.Model):
|
||||
from_times = str(current_data) + " " + from_time
|
||||
from_ti = datetime.strptime(from_times, "%Y-%m-%d %H:%M")
|
||||
return from_ti
|
||||
|
||||
@staticmethod
|
||||
def utils_list_page(data, limit):
|
||||
"""
|
||||
列表平分
|
||||
:param data: list
|
||||
:param limit: 每组多少个
|
||||
:return: 平分结果
|
||||
"""
|
||||
for start in range(0, len(data), limit):
|
||||
if start + limit > len(data):
|
||||
end = len(data)
|
||||
else:
|
||||
end = start + limit
|
||||
yield data[start:end]
|
||||
@@ -18,6 +18,12 @@ class PlanningTemplate(models.Model):
|
||||
planning_name = fields.Char(string='名称')
|
||||
color = fields.Integer("颜色", default=_get_default_color)
|
||||
|
||||
check_in_start = fields.Char(string="上班开始")
|
||||
check_in_end = fields.Char(string="上班结束")
|
||||
|
||||
check_out_start = fields.Char(string="下班开始")
|
||||
check_out_end = fields.Char(string="下班结束")
|
||||
|
||||
def _compute_name(self):
|
||||
super()._compute_name()
|
||||
user_tz = pytz.timezone(self.env['planning.slot']._get_tz())
|
||||
|
||||
@@ -35,3 +35,9 @@ access_yuthon_special_approval,yuthon.special.approval,model_yuthon_special_appr
|
||||
access_card_remind_form,card.remind.form,model_card_remind_form,base.group_user,1,1,1,1
|
||||
access_yuthon_customer_planning,yuthon.customer.planning,model_yuthon_customer_planning,base.group_user,1,1,1,1
|
||||
access_customer_plan_line,customer.plan.line,model_customer_plan_line,base.group_user,1,1,1,1
|
||||
|
||||
access_hr_attendance_detail_user,hr.attendance.detail.user,model_hr_attendance_detail,base.group_user,1,0,0,0
|
||||
access_hr_attendance_detail_manager,hr.attendance.detail.manager,model_hr_attendance_detail,base.group_user,1,1,1,1
|
||||
|
||||
access_hr_attendance_detail_image_user,hr.attendance.detail.image.user,model_hr_attendance_detail_image,base.group_user,1,0,0,0
|
||||
access_hr_attendance_detail_image_manager,hr.attendance.detail.image.manager,model_hr_attendance_detail_image,base.group_user,1,1,1,1
|
||||
|
||||
|
@@ -15,11 +15,9 @@
|
||||
* 新增 API 获取临时素材
|
||||
* 新增 定时任务 和 刷新access_token的代码
|
||||
""",
|
||||
'depends': ['base', 'auth_oauth', 'hr', 'yuthon_hr_attendance'],
|
||||
'depends': ['base', 'auth_oauth', 'hr'],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'data/hr_attendance_time.xml',
|
||||
# 'data/wecom_apps_cron_data.xml',
|
||||
'data/wecom_api_data.xml',
|
||||
'data/auth_oauth_provider.xml',
|
||||
'views/wecom_api_views.xml',
|
||||
@@ -27,10 +25,7 @@
|
||||
'views/hr_employee_views.xml',
|
||||
'views/wecom_apps_config_views.xml',
|
||||
'wizard/wecom_api_sync_wizard.xml',
|
||||
'views/hr_attendance_views.xml',
|
||||
'views/hr_attendance_detail_views.xml',
|
||||
'views/wx_work_views.xml',
|
||||
'views/planning_slot_template_views.xml',
|
||||
],
|
||||
'application': True,
|
||||
'installable': True,
|
||||
|
||||
@@ -5,10 +5,8 @@ from . import wecom_apps
|
||||
from . import hr_employee
|
||||
from . import res_users
|
||||
from . import wecom_apps_config
|
||||
from . import hr_attendance_detail
|
||||
from . import wx_work
|
||||
from . import hr_attendance
|
||||
from . import planning_slot_template
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import api, fields, models, _
|
||||
|
||||
|
||||
class PlanningTemplate(models.Model):
|
||||
_inherit = 'planning.slot.template'
|
||||
|
||||
check_in_start = fields.Char(string="上班开始")
|
||||
check_in_end = fields.Char(string="上班结束")
|
||||
|
||||
check_out_start = fields.Char(string="下班开始")
|
||||
check_out_end = fields.Char(string="下班结束")
|
||||
|
||||
@@ -4,9 +4,3 @@ access_wecom_apps,wecom.apps.user,model_wecom_apps,,1,1,1,1
|
||||
access__wecom_apps_config,wecom.app.config.user,model_wecom_apps_config,,1,1,1,1
|
||||
|
||||
access_wecom_api_sync_wizard_manager,wecom.api.sync.wizard,model_wecom_api_sync_wizard,,1,1,1,1
|
||||
|
||||
access_hr_attendance_detail_user,hr.attendance.detail.user,model_hr_attendance_detail,base.group_user,1,0,0,0
|
||||
access_hr_attendance_detail_manager,hr.attendance.detail.manager,model_hr_attendance_detail,base.group_user,1,1,1,1
|
||||
|
||||
access_hr_attendance_detail_image_user,hr.attendance.detail.image.user,model_hr_attendance_detail_image,base.group_user,1,0,0,0
|
||||
access_hr_attendance_detail_image_manager,hr.attendance.detail.image.manager,model_hr_attendance_detail_image,base.group_user,1,1,1,1
|
||||
|
||||
|
Reference in New Issue
Block a user