@@ -347,10 +347,12 @@ class HrAttendance(models.Model):
|
||||
user_id=emp.wecom_userid,
|
||||
title=f'【{title}】',
|
||||
description='考勤异常请尽快处理',
|
||||
exception_alerts = True,
|
||||
url=url, btntxt="查看详情")
|
||||
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='att',
|
||||
user_id='18562027762',
|
||||
title='【考勤异常提醒】',
|
||||
exception_alerts=True,
|
||||
description='考勤异常请尽快处理',
|
||||
url=url, btntxt="查看详情")
|
||||
|
||||
|
||||
@@ -530,7 +530,7 @@
|
||||
<group>
|
||||
<field name="is_back" invisible="1"/>
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="contract_id" invisible="contract_type != 'lease_renewal'"/>
|
||||
<field name="contract_id" invisible="not contract_id"/>
|
||||
<field name="rent_company" string="出租方" invisible="contract_sort != 'property'"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="lessee_id"/>
|
||||
|
||||
@@ -111,7 +111,7 @@ class WeComApps(models.Model):
|
||||
_logger.info(f"------------------------获取msg_id:{msg_id}tokenID:{token}当前url{url}-------------------------------")
|
||||
requests.post(url=url, data=json.dumps(data))
|
||||
|
||||
def sync_send_message_textcard(self, content_item='', touser='', category='default', user_id=None, title="", description="", url="", btntxt="详情"):
|
||||
def sync_send_message_textcard(self, content_item='', touser='', category='default', user_id=None, title="", description="", url="", btntxt="详情", exception_alerts = False):
|
||||
"""
|
||||
touser 否 成员ID列表(消息接收者,多个接收者用‘|’分隔,最多支持1000个)。特殊情况:指定为@all,则向关注该企业应用的全部成员发送
|
||||
toparty 否 部门ID列表,多个接收者用‘|’分隔,最多支持100个。当touser为@all时忽略本参数
|
||||
@@ -175,6 +175,19 @@ class WeComApps(models.Model):
|
||||
},
|
||||
}
|
||||
elif category == 'att':
|
||||
if exception_alerts == True:
|
||||
data = {
|
||||
'touser': user_id,
|
||||
'msgtype': 'textcard',
|
||||
'agentid': wecom_app.agent_id,
|
||||
"textcard": {
|
||||
"title": title,
|
||||
"description": description,
|
||||
"url": url,
|
||||
"btntxt": btntxt
|
||||
},
|
||||
}
|
||||
else:
|
||||
data = {
|
||||
"touser": user_id,
|
||||
"msgtype": "miniprogram_notice",
|
||||
|
||||
Reference in New Issue
Block a user