Skip to content

DOC: Running it in virtualenv #2

@rvalyi

Description

@rvalyi

Hello this not a bug report but a note how to run such an Odoo v16 project in virtualenv so it is not lost before we put it somewhere else.

This assumes you installed Postgresql and have it running on localhost with an odoo user with some_password.

python -m venv odoo
source odoo/bin/activate
pip install lxml==4.9.2  # this avoids ImportError: lxml.html.clean module is now a separate project lxml_html_clean
pip install -e odoo/src
odoo -s -c odoo.cfg --stop-after-init
# edit odoo.cfg, set db_host=localhost, db_user=odoo,db_password=some_password and put the result of ak build --links | sed 's#/odoo/#odoo/#g' into addons_path
odoo -c odoo.cfg

You need to do that only once for at least each Odoo serie, like DEV/odoo16, DEV/odoo17, DEV/odoo18 ...
Once you have a base venv for the serie, you can simply run a customer project with:
clone or create the docky project.

cp $VIRTUAL_ENV/../odoo.cfg odoo.cfg
# edit odoo.cfg and add the path to the project odoo/local-src in the ADDONS_PATH:
odoo -c odoo.cfg

NOTE: for Odoo 18.0, you may also need to do:

pip install "zope.interface==6.4.post2
pip install "zope.event==5.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions