Сообщение #1
03 февраля 2019, 15:44
|
Интеграция Odoo.
Всем здравствуйте. Очень нужна ваша помощь!!!
В прилагаемом файле начало его реализации. Помимо основного функционала, который необходимо реализовать (описано в файле комментариями), необходимо так же сделать форму настройки модуля в Odoo.
Файл не загружается вот код программы.
#!/usr/bin/env python
import skpy
import argparse
from flask import Flask, request
import requests
import simplejson as json
import logging
import threading
_logger = logging.getLogger(__name__)
app = Flask(__name__)
"""
So here is the flask app, that uses skpy library to login in the acc and listen Skype events.
We want to know, if you can write an app for Odoo Community Edition v12, that will starts with odoo, listen the specific skype-channel and send it to admin-user in Odoo as message.
NOTE: module should work as odoo-module. No stand-alone microservers. No Flask either!
"""
# flask run --host=0.0.0.0 --port=80
# skpy.t.allofti.me/usage.html
class MySkype(skpy.SkypeEventLoop):
def onEvent(self, event):
if isinstance(event, skpy.SkypeNewMessageEvent):
# some help for you. You can see all the properties in docs(link is in header)
print(repr(event))
print('New message from user {} at {}: \'{} \''.format(event.msg.userId,
event.msg.time.strftime('%H:%M dd. %d.%m.%Y'),
event.msg.content))
#you must add here functionality to pass the message to odoo user with id = 1
if __name__ == '__main__':
from skpy import Skype
global client
global sk
client = Skype('dummy.org', 'pass', '.skype_token')
sk = MySkype(tokenFile=".skype_token", autoAck=True)
thread = threading.Thread(target=sk.loop)
thread.start()
app.run(host='0.0.0.0', port=8766)
"""
N.B.
If you hate Skype as Microsoft product, you can choose another test task.
Odoo can notify user about all events the user is subscribed for. In Properties of the User you can choose — In Odoo or On Email. So, you can write the addon, that adds third or standalone option — Notify in Telegram. And if user check it, all the notifications should go to user as simple message or as bot message.
Fell free to ask for details
""
В прилагаемом файле начало его реализации. Помимо основного функционала, который необходимо реализовать (описано в файле комментариями), необходимо так же сделать форму настройки модуля в Odoo.
Файл не загружается вот код программы.
#!/usr/bin/env python
import skpy
import argparse
from flask import Flask, request
import requests
import simplejson as json
import logging
import threading
_logger = logging.getLogger(__name__)
app = Flask(__name__)
"""
So here is the flask app, that uses skpy library to login in the acc and listen Skype events.
We want to know, if you can write an app for Odoo Community Edition v12, that will starts with odoo, listen the specific skype-channel and send it to admin-user in Odoo as message.
NOTE: module should work as odoo-module. No stand-alone microservers. No Flask either!
"""
# flask run --host=0.0.0.0 --port=80
# skpy.t.allofti.me/usage.html
class MySkype(skpy.SkypeEventLoop):
def onEvent(self, event):
if isinstance(event, skpy.SkypeNewMessageEvent):
# some help for you. You can see all the properties in docs(link is in header)
print(repr(event))
print('New message from user {} at {}: \'{} \''.format(event.msg.userId,
event.msg.time.strftime('%H:%M dd. %d.%m.%Y'),
event.msg.content))
#you must add here functionality to pass the message to odoo user with id = 1
if __name__ == '__main__':
from skpy import Skype
global client
global sk
client = Skype('dummy.org', 'pass', '.skype_token')
sk = MySkype(tokenFile=".skype_token", autoAck=True)
thread = threading.Thread(target=sk.loop)
thread.start()
app.run(host='0.0.0.0', port=8766)
"""
N.B.
If you hate Skype as Microsoft product, you can choose another test task.
Odoo can notify user about all events the user is subscribed for. In Properties of the User you can choose — In Odoo or On Email. So, you can write the addon, that adds third or standalone option — Notify in Telegram. And if user check it, all the notifications should go to user as simple message or as bot message.
Fell free to ask for details
""