odoo的消息通信分为前端-前端(core.bus.trigger)和前端-后端(longpolling)
记录一下core.bus,trigger使用,longpolling使用在另一篇文章,有兴趣可以查看
1.代码演示:
core.bus.trigger('update_menu_info')# 发送消息
core.bus.on('update_menu_info', this, function () {
# 消息处理逻辑
}); #监听消息
如有疑问,请留言