I am trying to programmatically post a message (not email). But I don't know how. The message for example can show up in the discussion app , #generals channel. I searched the internet but all I get it is how to send email messages to users using the mail.thread object.
in other words how to accomplish the following using python code
<record model="mail.message" id="module_install_notification">
<field name="model">mail.channel</field>
<field name="res_id" ref="mail.channel_all_employees"/>
<field name="message_type">notification</field>
<field name="subtype_id" ref="mail.mt_comment"/>
<field name="subject">Project Management application installed!</field>
<field name="body"><![CDATA[<p>Manage multi-level projects and tasks. You can delegate tasks, track task work, and review your planning.</p>
<p>You can manage todo lists on tasks by installing the <i>Todo Lists</i> application, supporting the Getting Things Done (GTD) methodology.</p>
<p>You can also manage issues/bugs in projects by installing the "Issue Tracker" application.</p>]]></field>
</record>
The above xml code posts the "body" to the #general channel of the Discuss app.
I am using odoo v9.