Skip to content

Instantly share code, notes, and snippets.

@simahawk
Last active February 12, 2019 11:13
Show Gist options
  • Save simahawk/20a85e8cec7c551f739c8f46d3e7cf3b to your computer and use it in GitHub Desktop.
Save simahawk/20a85e8cec7c551f739c8f46d3e7cf3b to your computer and use it in GitHub Desktop.
Odoo simple local setup via pip (example for cms repo)
[run]
omit =
*/tests/*
*__manifest__.py
[pytest]
filterwarnings =
error
ignore::DeprecationWarning

Install

pip install -r requirements.txt

Run odoo

odoo -c odoo.cfg

Run odoo tests

odoo -c odoo.cfg -u foo --stop-after-init --test-enable

Run pytest

export OPENERP_SERVER=./odoo.cfg
pytest -s --odoo-database=$DB_NAME --disable-pytest-warnings path/to/module

Run pytest w/ coverage

export OPENERP_SERVER=./odoo.cfg
pytest -s --odoo-database=$DB_NAME --disable-pytest-warnings --cov=odoo.addons.$ADDON --cov-report=term-missing --cov-config=./.coveragerc $ADDON
[options]
running_env=dev
db_name=cms11
db_filter=cms11
# note that in this way the extra addons will be discoverable only if pip-installed
# If you want to discover whole paths... add them here.
addons_path=/path/to/your/project/odoo/addons
# given for granted that you have Odoo src inside ./odoo
-r ./odoo/requirements.txt
-e ./odoo
# needed if you don't update addons_path
-e ./website-cms/setup/cms_form
-e ./website-cms/setup/cms_info
-e ./website-cms/setup/cms_delete_content
-e ./website-cms/setup/cms_status_message
-e ./website-cms/setup/cms_account_form
-e ./website-cms/setup/cms_notification
-e ./website-cms/setup/cms_toolbar
odoo11-addon-base-technical-features
setuptools-odoo
# tests
pytest == 4.0.1
pytest-odoo >= 0.4.1
pytest-cov
responses
# dev
pdbpp
readline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment