Project
Function
Sample CLI
gway odoo send-chat
Full Code
def send_chat(message: str, *, username: str = "[ODOO_USERNAME]") -> bool:
"""
Send a chat message to an Odoo user by username.
"""
user_info = get_user_info(username=username)
if not user_info:
return False
user_id = user_info["id"]
return execute_kw(
model="mail.channel",
method="message_post",
kwargs={
"partner_ids": [(4, user_id)],
"body": message,
"message_type": "comment",
"subtype_xmlid": "mail.mt_comment",
},
)