Help

1

How to run odoo 10 and odoo 12 together in one system on ubuntu 16.04?

Avatar
Mian Kamran

Hi,

I have odoo 10 running on my system, What type of environment do I require to run odoo 12 parallel to odoo 10 on ubuntu 16.04.

any suggestion on installation and server start and close as there is a major difference of python 2.7 and python 3.

1 Comment
Avatar
Discard
Avatar
Odoo Mates
-
9 Answers
1
Avatar
Mitul Shingala
Best Answer

hello,

using different xmlrpc-port you can run multiple odoo instance together.
for eg. 

v10 :   ./odoo-bin --addons-path=<addons-path> -d <database_name> --xmlrpc-port=8069

v12 :   ./odoo-bin --addons-path=<addons-path> -d <database_name> --xmlrpc-port=9000

so using --xmlrpc-port you can do it. also you can use --xmlrpc-port into the your odoo service file.

2 Comments
Avatar
Discard
Avatar
Mian Kamran
-

and what about the python versions?

Avatar
Mitul Shingala
-

by default odoo 10 run with python2.7 and odoo 12 run with python3

0

Hi Mian,

You can just install two Odoo instances next to eachother. As long as they're in separate folders and both run on their own Python versions you'll be fine. It is advised to run the two Odoo instances on different Linux users for security and transparency.
If you'd like I have an installation script that you can use to install multiple Odoo instances on one server, I use it all the time. See https://github.com/Yenthe666/InstallScript


Regards,
Yenthe

10 Comments
Avatar
Discard
Avatar
Mian Kamran
-

Thanks yenthe. Of course I am going to use your script but here is a question. Using this script can I specify the folder where I want to install odoo and when I will be done installing what will differentiate between the two version when i want to start there services through terminal like I can differentiate between port and folder but what about the python version?

This is all configurable in my script. When you change the directory for the Odoo instance, the XML-RPC port and the user it'll work fine out of the box. My script will handle the Python version that it uses depending on the Odoo version you install. The service name is built depending on the parameters too so you'll have unique service names :)

Avatar
Mian Kamran
-

Hi yenthe, I have installed your script its not working. Odoo 10 is working perfectly. When i saw the logs its throwing these errors:

----------------------------------------------------------------------------------------------------

Traceback (most recent call last):

File "/usr/local/lib/python3.5/dist-packages/werkzeug/serving.py", line 270, in run_wsgi

execute(self.server.app)

File "/usr/local/lib/python3.5/dist-packages/werkzeug/serving.py", line 258, in execute

application_iter = app(environ, start_response)

File "/kamran/kamran-server/odoo/service/server.py", line 350, in app

return self.app(e, s)

File "/kamran/kamran-server/odoo/service/wsgi_server.py", line 128, in application

return application_unproxied(environ, start_response)

File "/kamran/kamran-server/odoo/service/wsgi_server.py", line 117, in application_unproxied

result = odoo.http.root(environ, start_response)

File "/kamran/kamran-server/odoo/http.py", line 1318, in __call__

return self.dispatch(environ, start_response)

File "/kamran/kamran-server/odoo/http.py", line 1469, in dispatch

odoo.registry(db).check_signaling()

File "/kamran/kamran-server/odoo/__init__.py", line 81, in registry

return modules.registry.Registry(database_name)

File "/kamran/kamran-server/odoo/modules/registry.py", line 62, in __new__

return cls.new(db_name)

File "/kamran/kamran-server/odoo/modules/registry.py", line 86, in new

odoo.modules.load_modules(registry._db, force_demo, status, update_module)

File "/kamran/kamran-server/odoo/modules/loading.py", line 424, in load_modules

registry.setup_models(cr)

File "/kamran/kamran-server/odoo/modules/registry.py", line 264, in setup_models

model._setup_base()

File "/kamran/kamran-server/odoo/models.py", line 2579, in _setup_base

self.env['ir.model.fields']._add_manual_fields(self)

File "/kamran/kamran-server/odoo/addons/base/models/ir_model.py", line 940, in _add_manual_fields

field = self._instanciate(field_data)

File "/kamran/kamran-server/odoo/addons/base/models/ir_model.py", line 931, in _instanciate

attrs = self._instanciate_attrs(field_data)

File "/kamran/kamran-server/addons/mail/models/ir_model.py", line 70, in _instanciate_attrs

attrs = super(IrModelField, self)._instanciate_attrs(field_data)

File "/kamran/kamran-server/odoo/addons/base/models/ir_model.py", line 886, in _instanciate_attrs

'copy': bool(field_data['copied']),

KeyError: 'copied' - - -

------------------------------------------------------------------------------

AND

Traceback (most recent call last):

File "/kamran/kamran-server/odoo/modules/registry.py", line 60, in __new__

return cls.registries[db_name]

File "/kamran/kamran-server/odoo/tools/func.py", line 69, in wrapper

return func(self, *args, **kwargs)

File "/kamran/kamran-server/odoo/tools/lru.py", line 44, in __getitem__

a = self.d[obj].me

KeyError: 'GasandOil'

------------------------------------------------------

THAT WOULD BE A GREAT HELP IF YOU HELP ME MAKE IT RUNNING.

Avatar
Mian Kamran
-

HERE ARE SOME MORE ERRORS ON THE TOP RIGHT AFTER THE SERVER STARTS

-------------------------------------------------------------------

/usr/local/lib/python3.5/dist-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.

""")

/usr/local/lib/python3.5/dist-packages/requests-2.21.0-py3.5.egg/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.24.1) or chardet (2.3.0) doesn't match a supported version!

RequestsDependencyWarning)

------------------------------------------------------------

AND

------------------------------------------------------------

Traceback (most recent call last):

File "/kamran/kamran-server/odoo/service/server.py", line 989, in load_server_wide_modules

odoo.modules.module.load_openerp_module(m)

File "/kamran/kamran-server/odoo/modules/module.py", line 368, in load_openerp_module

__import__('odoo.addons.' + module_name)

File "/kamran/kamran-server/odoo/modules/module.py", line 61, in load_module

f, path, (_suffix, _mode, type_) = imp.find_module(addon_name, ad_paths)

File "/usr/lib/python3.5/imp.py", line 296, in find_module

raise ImportError(_ERR_MSG.format(name), name=name)

ImportError: No module named 'web_kanban'

-----------------------------------------------------------------------

Hi, as answered on the Github topic you install multiple Odoo instances with the same system & postgreSQL user, resulting in all these errors.

Avatar
Mian Kamran
-

Now how to uninstall the script?

Avatar
Jorge
-

Hi Yenthe, Is there any posibilty for be in contact you through email? I have a little question about your odoo installation script!!

Feel free to reach out on Github or Twitter ;)

Avatar
Muhanad
-

i'm having a problem regarding the addons-path, no matter what i do, the default addons path "/usr/lib/python3/dist-packages/odoo/addons" is stuck there, at lease with v13 and v14. I tried to set the "addons-path" parameter inside the config file, tried to add "--addons-path" option to the command line, but didn't work. then i'v read this:

--addons-path=ADDONS_PATH

specify """additional""" addons paths (separated by commas).

does that mean, the default is immutable? Any suggestions would be appreciated! Thanks in advance!

Avatar
Muhanad
-

I edited this file ˜/odoo/odoo/cli/server.py:

def main(args):

check_root_user()

odoo.tools.config.parse_config(args)

check_postgres_user()

report_configuration()

.

.

.

INTO:

def main(args):

check_root_user()

odoo.tools.config.parse_config(args)

config = odoo.tools.config

odoo.addons.__path__.remove('/usr/lib/python3/dist-packages/odoo/addons')

check_postgres_user()

report_configuration()

.

.

.

I'm still testing what kind of effect does it have on the platform, trying out multiple combinations of configurations, till i reach something, but at least currently it worked.

0
Avatar
La Jayuhni Yarsyah
Best Answer

I had a production server that run multiple odoo instance (odoo10, odoo11 and odoo12) and its no problem at all

Just only by simple configuration:

  1. Don't use same port for xmlrpc_port and longpolling_port, you can configure it on config file

  2. I use python virtual environtment some each instance, because odoo10  use python2 and odoo 11 and 12 using python 3.

  3. I create different user of postgresql on each version ,for example for user on odoo10 instance i create "odoo10pgusr",, for odoo11 instance i create "odoo11pgusr" and for odoo12, i create "odoo12pgusr"

    Hope will done your problem.
    Regards..

Avatar
Discard