forked from erp-dev/erp
feat: settlement lineup
This commit is contained in:
@@ -296,9 +296,10 @@ def on_printing_order_created(sender, **kwargs):
|
||||
if outgoing_dt is not None
|
||||
else "-"
|
||||
)
|
||||
order_id = str(getattr(order, "id", "-") or "-")
|
||||
|
||||
message = render_printing_order_created_markdown(
|
||||
printing_order_id=str(getattr(order, "id", "-") or "-"),
|
||||
printing_order_id=order_id,
|
||||
printing_order_human_id=str(getattr(order, "human_id", "-") or "-"),
|
||||
created_at=str(created_at),
|
||||
sender_label=str(sender_label),
|
||||
@@ -325,5 +326,15 @@ def on_printing_order_created(sender, **kwargs):
|
||||
except Exception:
|
||||
logger.exception("[printing.handlers] 发送 WeCom webhook 失败(已忽略,不影响主流程)")
|
||||
|
||||
# Just for testing
|
||||
# ==============================================================
|
||||
try:
|
||||
from flower.utils import play_speech
|
||||
|
||||
play_speech(text=f"生产订单 {order_id} 已创建")
|
||||
except Exception:
|
||||
logger.exception("[printing.handlers] 发送语音播报失败(已忽略,不影响主流程)")
|
||||
# ===================================
|
||||
|
||||
# 在事务提交后再发送,避免事务回滚但通知已发出
|
||||
transaction.on_commit(_send_wecom)
|
||||
|
||||
Reference in New Issue
Block a user