- Setup postgres 10+
- Setup Python 3.6+ venv
virtualenv /path/envdir
- Install Odoo from source
- Open in PyCharm and pick venv, then in Odoo root run
pip install -e .
- Run
pip install odoo-autodiscovery
- Create/install addons
- Start Odoo with server.conf
Example:
pip install odoo13-addon-my-addon
Installing from source allows the addon to be changed even after installing.
Change to the addon folder, where the
setup.py
file resides, and run the command
pip install -e .
Note: Dependencies are only resolved for published modules. Dependencies for source modules need to be manually installed in the correct order.
Assuming, you copied the distributable packages to
/home/user/Documents/python-packages
the command
would be:
pip install --no-index --find-links file:///home/user/Documents/python-packages odoo13-addon-my-addon
Dependencies between modules will be resolved.
Example:
addons-own
- my_addon
- setup
- my_addon
- odoo
- addons
- my_addon (sym-link into addons-own/my_addon)
- setup.py
This should be similar to how OCA
sets up their environment.
Source: setuptools-odoo
Required folder structure:
odoo
- addons
- <addon_name>
- __manifest__.py
- ...
setup.py
Contents of setup.py
:
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
Without additional attributes, this creates packages with
the name odoo<version>-addon-<addon_name>
. For example odoo13-addon-my-addon
.
To create distributable packages, run the following command from within the package directory:
python setup.py sdist bdist_wheel
This creates a dist
folder containing the packages.
Version will be the same as specified in the Odoo manifest.
Default scheme: +1.devN
- Use exact manifest version, if the last commit changed the version
- Use manifest +1.devN if there are commits that do not change version, N is the number of commits since last version change
Example history for an Odoo module:
Manifest version 13.0.0.0.1 (last commit set this version)
Publish version: 13.0.0.0.1
Manifest version 13.0.0.0.1 (4 commits changing code only)
Publish version: 13.0.0.0.2.dev4
Manifest version 13.0.0.0.2 (last commit set this version, signifies a release)
Publish version: 13.0.0.0.2
Manifest version 13.0.0.0.2 (1 commits changing code only)
Publish version: 13.0.0.0.3.dev1
In the project view, right click the desired folder, select
Mark Directory as
and Excluded
.
Excluded folders are stored in an .iml file, e.g. .idea/online_o13.iml
.
The reinclude either adjust the .iml file, or select the folder
(do not right click), then right click in the bread crumb
section. In project view the Mark Directory as
will be disabled,
in bread crumb section it is available.