diff --git a/yuthon_wechat/models/wecom_apps.py b/yuthon_wechat/models/wecom_apps.py index 347482748..6dbbc8c73 100644 --- a/yuthon_wechat/models/wecom_apps.py +++ b/yuthon_wechat/models/wecom_apps.py @@ -160,15 +160,14 @@ class WeComApps(models.Model): }, } result_data = self.sync_function_api("message_send", "MESSAGE_SEND", data, category) - if category == 'att': - employee_id = self.env["res.users"].search([("id", "=", user_id)], limit=1).employee_ids - self.env["attendance.message.log"].create({ - "employee_id": employee_id.id, - "content": description, - "notice_type": 'attendance', - 'update_date': fields.Datetime.now(), - "message_url": url, - }) + employee_id = self.env["res.users"].search([("id", "=", user_id)], limit=1).employee_ids + self.env["attendance.message.log"].create({ + "employee_id": employee_id.id, + "content": description, + "notice_type": 'attendance', + 'update_date': fields.Datetime.now(), + "message_url": url, + }) if result_data.get("errcode", None) == 0: return True, result_data return False, result_data