Hello, I'm trying to replicate some functionality from Slack into Odoo Discuss. We have some custom scripts that monitor our web businesses and post to an Odoo Discuss/Chat channel automatically. After the script runs, channel members are not notified and cannot even see the message until after refreshing the browser.
Here's the script:
import xmlrpc.client
def postProcessing(message):
url = "https://x.odoo.com"
db = 'zzzzzzzzz'
username = 'xxxxxxx'
password = 'yyyyyyy'
common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
common.version()
{
"server_version": "8.0",
"server_version_info": [8, 0, 0, "final", 0],
"server_serie": "8.0",
"protocol_version": 1,
}
uid = common.authenticate(db, username, password, {})
models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url))
id = models.execute_kw(db, uid, password, 'mail.message', 'create', [{
'model': 'mail.channel',
'res_id': 14, #from/reference channel
'body': message, # here add the message body
'channel_ids': [14], #channel ID to post to
'author_id': 1,
'author_avatar': False
}])
print (id)
postProcessing("test?")
The script successfully posts a message, but it only appears in the channel after refreshing the browser. Even clicking around in Odoo and coming back doesn't refresh it. How to get it to show automatically?
Hi,
Can you try after setting the workers=1 in your .conf file?
i have the same problem. have you found a solution to this problem?
Unfortunately never solved