hi all, today i want to share about how to setup IM (instant messaging) on OpenERP 7, actually it will launch on Openerp V8, but i saw the module was release in trunk.
lets start :
1. install gevent lib.
sudo apt-get install python-gevent
sudo pip install gevent-psycopg2
2. make gevent running on openerp
vim openerp/cli/server.py
# febru@soluvas.com
if openerp.tools.config.options["gevent"]:
_logger.info('Using gevent mode')
import gevent
import gevent.monkey
gevent.monkey.patch_all()
import gevent.wsgi
import gevent_psycopg2
gevent_psycopg2.monkey_patch()
openerp.evented = True
_logger.info('Using gevent mode')
else:
openerp.evented = False
vim openerp/service/__init__.py
vim openerp/service/workers.py
vim openerp/service/wsgi_server.py
vim openerp/tools/config.py
4. test your changes with
./openerp-server --gevent
5. update and activate your im module on setting-menu then see the chat is running
references :
http://help.openerp.com/question/22521/how-to-activate-chat-im-in-v8-trunk/
https://pypi.python.org/pypi/gevent-psycopg2
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-gevent/+merge/125848
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-chat2-niv/+merge/149177
https://lists.launchpad.net/openerp-dev-gtk/msg30996.html
lets start :
sudo apt-get install python-gevent
sudo pip install gevent-psycopg2
2. make gevent running on openerp
vim openerp/cli/server.py
# febru@soluvas.com
if openerp.tools.config.options["gevent"]:
_logger.info('Using gevent mode')
import gevent
import gevent.monkey
gevent.monkey.patch_all()
import gevent.wsgi
import gevent_psycopg2
gevent_psycopg2.monkey_patch()
openerp.evented = True
_logger.info('Using gevent mode')
else:
openerp.evented = False
vim openerp/service/__init__.py
vim openerp/service/workers.py
vim openerp/service/wsgi_server.py
vim openerp/tools/config.py
4. test your changes with
./openerp-server --gevent
5. update and activate your im module on setting-menu then see the chat is running
instant messenger source code
references :
http://help.openerp.com/question/22521/how-to-activate-chat-im-in-v8-trunk/
https://pypi.python.org/pypi/gevent-psycopg2
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-gevent/+merge/125848
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-chat2-niv/+merge/149177
https://lists.launchpad.net/openerp-dev-gtk/msg30996.html
hi all, today i want to share about how to setup IM (instant messaging) on OpenERP 7, actually it will launch on Openerp V8, but i saw the module was release in trunk.
lets start :
1. install gevent lib.
sudo apt-get install python-gevent
sudo pip install gevent-psycopg2
2. make gevent running on openerp
vim openerp/cli/server.py
# febru@soluvas.com
if openerp.tools.config.options["gevent"]:
_logger.info('Using gevent mode')
import gevent
import gevent.monkey
gevent.monkey.patch_all()
import gevent.wsgi
import gevent_psycopg2
gevent_psycopg2.monkey_patch()
openerp.evented = True
_logger.info('Using gevent mode')
else:
openerp.evented = False
vim openerp/service/__init__.py
vim openerp/service/workers.py
vim openerp/service/wsgi_server.py
vim openerp/tools/config.py
4. test your changes with
./openerp-server --gevent
5. update and activate your im module on setting-menu then see the chat is running
references :
http://help.openerp.com/question/22521/how-to-activate-chat-im-in-v8-trunk/
https://pypi.python.org/pypi/gevent-psycopg2
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-gevent/+merge/125848
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-chat2-niv/+merge/149177
https://lists.launchpad.net/openerp-dev-gtk/msg30996.html
lets start :
sudo apt-get install python-gevent
sudo pip install gevent-psycopg2
2. make gevent running on openerp
vim openerp/cli/server.py
# febru@soluvas.com
if openerp.tools.config.options["gevent"]:
_logger.info('Using gevent mode')
import gevent
import gevent.monkey
gevent.monkey.patch_all()
import gevent.wsgi
import gevent_psycopg2
gevent_psycopg2.monkey_patch()
openerp.evented = True
_logger.info('Using gevent mode')
else:
openerp.evented = False
vim openerp/service/__init__.py
vim openerp/service/workers.py
vim openerp/service/wsgi_server.py
vim openerp/tools/config.py
4. test your changes with
./openerp-server --gevent
5. update and activate your im module on setting-menu then see the chat is running
instant messenger source code
references :
http://help.openerp.com/question/22521/how-to-activate-chat-im-in-v8-trunk/
https://pypi.python.org/pypi/gevent-psycopg2
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-gevent/+merge/125848
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-chat2-niv/+merge/149177
https://lists.launchpad.net/openerp-dev-gtk/msg30996.html
saya coba ikuti instruksi di atas tapi error, infonya seperti di bawah
ReplyDelete2013-09-07 05:44:04,201 17111 INFO ? openerp: OpenERP version 7.0-20130730-231022
2013-09-07 05:44:04,201 17111 INFO ? openerp: addons paths: /opt/openerp/server/openerp/addons
2013-09-07 05:44:04,201 17111 INFO ? openerp: database hostname: localhost
2013-09-07 05:44:04,201 17111 INFO ? openerp: database port: 5432
2013-09-07 05:44:04,201 17111 INFO ? openerp: database user: openerp
2013-09-07 05:44:04,374 17111 INFO ? openerp.addons.google_docs.google_docs: GData lib version `%s GData-Python/2.0.18` detected
2013-09-07 05:44:04,391 17111 CRITICAL ? openerp.modules.module: Couldn't load module web
2013-09-07 05:44:04,391 17111 CRITICAL ? openerp.modules.module: cannot import name request
2013-09-07 05:44:04,391 17111 ERROR ? openerp.service: Failed to load server-wide module `web`.
The `web` module is provided by the addons found in the `openerp-web` project.
Maybe you forgot to add those addons in your addons_path configuration.
Traceback (most recent call last):
File "/opt/openerp/server/openerp/service/__init__.py", line 60, in load_server_wide_modules
openerp.modules.module.load_openerp_module(m)
File "/opt/openerp/server/openerp/modules/module.py", line 415, in load_openerp_module
getattr(sys.modules['openerp.addons.' + module_name], info['post_load'])()
File "/opt/openerp/server/openerp/addons/web/http.py", line 628, in wsgi_postload
openerp.wsgi.register_wsgi_handler(Root())
File "/opt/openerp/server/openerp/addons/web/http.py", line 517, in __init__
self.load_addons()
File "/opt/openerp/server/openerp/addons/web/http.py", line 580, in load_addons
m = __import__('openerp.addons.' + module)
File "/opt/openerp/server/openerp/modules/module.py", line 133, in load_module
mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
File "/opt/openerp/server/openerp/addons/im/__init__.py", line 2, in
import im
File "/opt/openerp/server/openerp/addons/im/im.py", line 26, in
from openerp.addons.web.http import request
ImportError: cannot import name request
2013-09-07 05:44:04,396 17111 INFO ? openerp.service.wsgi_server: HTTP service (werkzeug) running on 0.0.0.0:8069
terima kasih sebelumnya :-), kenapa?
base on your log, thats because of gevent not load, try to change my_default to True on openerp/tools/config.py
ReplyDeletegroup.add_option("--gevent", dest="gevent", action="store_true", my_default=True, help="Activate the GEvent mode, this also desactivate the cron.")
base on your log, thats because of gevent not load, try to change my_default to True on openerp/tools/config.py
ReplyDeletegroup.add_option("--gevent", dest="gevent", action="store_true", my_default=True, help="Activate the GEvent mode, this also desactivate the cron.")
thank i try it
ReplyDeleteHi Febru Wasono,
ReplyDeleteThanks for your Tur. I follow your tur but when run ./openerp-server --gevent it's give error:
Traceback (most recent call last):
File "/opt/openerp/server/openerp-server", line 2, in
import openerp
File "/opt/openerp/server/openerp/__init__.py", line 39, in
import addons
File "/opt/openerp/server/openerp/addons/__init__.py", line 38, in
from openerp.modules import get_module_resource, get_module_path
File "/opt/openerp/server/openerp/modules/__init__.py", line 27, in
from . import db, graph, loading, migration, module, registry
File "/opt/openerp/server/openerp/modules/graph.py", line 32, in
import openerp.osv as osv
File "/opt/openerp/server/openerp/osv/__init__.py", line 22, in
import osv
File "/opt/openerp/server/openerp/osv/osv.py", line 30, in
import orm
File "/opt/openerp/server/openerp/osv/orm.py", line 62, in
import fields
File "/opt/openerp/server/openerp/osv/fields.py", line 47, in
import openerp.tools as tools
File "/opt/openerp/server/openerp/tools/__init__.py", line 24, in
from config import config
File "/opt/openerp/server/openerp/tools/config.py", line 127
group.add_option("--longpolling-port", dest="longpolling_port", my_default=8072,
^
IndentationError: unexpected indent
My Openerp v.7
run on rhel 6.3
python 2.6
postgresql 8.4
Thanks for your help.
hi ...
Deleteplease check your indentication, its just about your last line "IndentationError: unexpected indent"
Hi Febru!
ReplyDeleteI need your help, i installed and configure as your doc but i have some problems.
1) Now i need use db password for launch openerp
log when launch:
~/lp/openerp$ ./openerp-server --gevent -w open
2013-11-10 16:34:02,807 21865 INFO ? openerp: OpenERP version 7.0
2013-11-10 16:34:02,807 21865 INFO ? openerp: addons paths: /home/openerp/lp/openerp/openerp/addons
2013-11-10 16:34:02,808 21865 INFO ? openerp: database hostname: localhost
2013-11-10 16:34:02,808 21865 INFO ? openerp: database port: 5432
2013-11-10 16:34:02,808 21865 INFO ? openerp: database user: openerp
2013-11-10 16:34:03,074 21865 INFO ? openerp.addons.google_docs.google_docs: GData lib version `%s GData-Python/2.0.17` detected
2013-11-10 16:34:03,229 21865 INFO ? openerp: OpenERP server is running, waiting for connections...
2013-11-10 16:34:03,230 21865 INFO ? openerp.service.wsgi_server: HTTP service (werkzeug) running on 0.0.0.0:8069
not 8072? why 8069...?
Hi VirtualTech...
Deleteits make new pooling port for chat only. so you will have 3 port open now.
2) when i copy IM folder in addons, then i make update from module manager, give me this error:
ReplyDeleteOpenERP Server Error
Client Traceback (most recent call last):
File "/home/openerp/lp/openerp/openerp/addons/web/http.py", line 204, in dispatch
response["result"] = method(self, **self.params)
File "/home/openerp/lp/openerp/openerp/addons/web/controllers/main.py", line 1132, in call_button
action = self._call_kw(req, model, method, args, {})
File "/home/openerp/lp/openerp/openerp/addons/web/controllers/main.py", line 1120, in _call_kw
return getattr(req.session.model(model), method)(*args, **kwargs)
File "/home/openerp/lp/openerp/openerp/addons/web/session.py", line 42, in proxy
result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
File "/home/openerp/lp/openerp/openerp/addons/web/session.py", line 30, in proxy_method
result = self.session.send(self.service_name, method, *args)
File "/home/openerp/lp/openerp/openerp/addons/web/session.py", line 103, in send
raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)
Server Traceback (most recent call last):
File "/home/openerp/lp/openerp/openerp/addons/web/session.py", line 89, in send
return openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/home/openerp/lp/openerp/openerp/netsvc.py", line 292, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/home/openerp/lp/openerp/openerp/service/web_services.py", line 626, in dispatch
res = fn(db, uid, *params)
File "/home/openerp/lp/openerp/openerp/osv/osv.py", line 188, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/home/openerp/lp/openerp/openerp/osv/osv.py", line 131, in wrapper
return f(self, dbname, *args, **kwargs)
File "/home/openerp/lp/openerp/openerp/osv/osv.py", line 197, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/openerp/lp/openerp/openerp/osv/osv.py", line 185, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/openerp/lp/openerp/openerp/addons/base/module/wizard/base_module_update.py", line 42, in update_module
update, add = module_obj.update_list(cr, uid,)
File "/home/openerp/lp/openerp/openerp/addons/base/module/module.py", line 617, in update_list
handler.load_addons()
File "/home/openerp/lp/openerp/openerp/addons/web/http.py", line 580, in load_addons
m = __import__('openerp.addons.' + module)
File "/home/openerp/lp/openerp/openerp/modules/module.py", line 133, in load_module
mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
File "/home/openerp/lp/openerp/openerp/addons/im/__init__.py", line 2, in
import im
File "/home/openerp/lp/openerp/openerp/addons/im/im.py", line 30, in
from openerp import http
ImportError: cannot import name http
maybe not start gevent?
Thanks for all.
Nico
maybe not start gevent?
Delete[no, its because you use different version of instant messaging module]
there are many approaches to make it live, i choose activate wsgi and make new port for pooling,
then you install instant messaging which running on http,
i suggest to download older version of IM with no http import
Hi, would you please point us where to get an older version of IM without the http import?
Deletei made changes as per in your blog but i can't find chat option V7 would you post the old version of IM (working version) here ?
ReplyDeleteit was uploaded on this site, see the bottom of this page, "download it here"
ReplyDeleteHi,
DeleteI followed same as you mentioned above, but i didn't find the old version im module in this site. Please give the link for im module.
Hello,
DeleteI can't download the source code from the link, please upsate it or give us a new link !!
How to configure gevent to run openerp as a service
ReplyDeleteI want to run openerp as "service openerp-server start" what needs to be done to have these things work on my server
Hi,
ReplyDeleteI am doing this in Windows.
I have followed the above code and done accordingly.
I have downloaded the gevent and gevent-psycopg2 and kept in my server.
Server is started but the application is not coming.
Help me from this error.
Hi, When I start the server from given instruction, I got below error
ReplyDeleteTraceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/attitude/workspace/server/openerp/service/wsgi_server.py", line 438, in serve
https = werkzeug.serving.make_server(interface, port, application, threaded= True)
File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.9_devdev_20140212-py2.7.egg/werkzeug/serving.py", line 461, in make_server
passthrough_errors, ssl_context)
File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.9_devdev_20140212-py2.7.egg/werkzeug/serving.py", line 391, in __init__
HTTPServer.__init__(self, (host, int(port)), handler)
File "/usr/lib/python2.7/SocketServer.py", line 408, in __init__
self.server_bind()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind
SocketServer.TCPServer.server_bind(self)
File "/usr/lib/python2.7/SocketServer.py", line 419, in server_bind
self.socket.bind(self.server_address)
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
error: [Errno 98] Address already in use
Rayaz : you need to update /etc/init.d/openerp to add gevent option then update your updaterc-d
ReplyDeleteSandeep : drop me your error log
Vendang : you need to change your port
how to solve this error on windows
Delete./openerp-server --gevent
Traceback (most recent call last):
File "openerp-server", line 5, in
File "D:\openerp\OpenERP\server\server\.\openerp\cli\__init__.py", line 61, in main
o.run(args)
File "D:\openerp\OpenERP\server\server\.\openerp\cli\server.py", line 285, in run
main(args)
File "D:\openerp\OpenERP\server\server\.\openerp\cli\server.py", line 233, in main
import gevent
File "D:\openerp\OpenERP\server\server\.\gevent\__init__.py", line 36, in
from gevent.hub import get_hub, iwait, wait
File "D:\openerp\OpenERP\server\server\.\gevent\hub.py", line 8, in
import greenlet # http://pypi.python.org/pypi/greenlet/
ImportError: No module named greenlet
Hi, Its working for me...
ReplyDeleteBut i am not able to restore the database after changes.
change my_default=False in config.py and check it
DeleteDear Febru,
ReplyDeleteThe Download link redirects to your Old Post,
Im not able to get the Source code.
Please provide it
Hi Febru,
ReplyDeleteHow can i download the source code???
THanks
Hi I am getting error after running the command ./openerp-server --gevent.
ReplyDeleteFile "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20130920_231040-py2.7.egg/openerp/modules/module.py", line 132, in load_module
f, path, descr = imp.find_module(module_part, ad_paths)
ImportError: No module named web_longpolling