首页 > 解决方案 > Odoo adding messages in oe_chatter

问题描述

I'm developing in Odoo Qweb and I need to add some messages in oe_chatter box when some events are thrown. Those messages had to be written in the next class: "calendar_event". Those are the records for written the messages:

@http.route('/events_accept/all/<int:meeting_id>', type='http', auth="user",website=True)
def meetings(self,meeting_id=None):
 event = request.env['calendar.event'].search([('id', '=', meeting_id)])
 msg_body = "....."
 #Write messages in oe_chatter 

Anyone knows how to do this task?

Thanks for reading!

标签: odooqweb

解决方案


应该足以调用message_post()记录calendar.event集。

event = request.env['calendar.event'].search([('id', '=', meeting_id)])
msg_body = "....."
event.message_post(body=msg_body)

如果您想使用聊天消息的子类型或其他功能,请查看message_post()以了解其可能性。


推荐阅读