添加功能

This commit is contained in:
李鹏宇
2026-03-14 17:24:51 +08:00
parent 6051ffbdb9
commit 3b1f9cb37d
+6 -9
View File
@@ -46,12 +46,18 @@ class YuthonCatering(models.Model):
def task_catering(self):
today = fields.Date.today()
tomorrow = today + timedelta(days=1)
employee_ids = self.env['yuthon.catering.conf'].search([])[0].employee_ids
future_menu_records = self.env['yuthon.menu.setting'].search([
('menu_date', '>', today)
])
if not future_menu_records:
return
tomorrow_menu = self.env['yuthon.menu.setting'].search([
('menu_date', '=', tomorrow)
], limit=1)
if not tomorrow_menu:
return
for emp in employee_ids:
url = f"https://phone.thtzjt.com/phone/Restaurant/{emp.user_id.id}"
self.sudo().env["wecom.apps"].sync_send_message_textcard(
@@ -62,15 +68,6 @@ class YuthonCatering(models.Model):
url=url,
btntxt="详细信息"
)
self.sudo().env["wecom.apps"].sync_send_message_textcard(
category='can',
user_id='18562027762',
title="餐饮通知",
description="请在 18:00 前登记次日用餐,18点后未填的系统将自动视为就餐。可在 21 点前进行修改。如有疑问,联系办公室。",
url=url,
btntxt="详细信息"
)
def task_conf(self):
tomorrow = fields.Date.today() + timedelta(days=1)