Odoo utility functions with command line interfaces.
Project description
odut
Odoo utility functions with commnd line interfaces.
1.Before runing the scripts, make sure you have activated your virtual enviroment, and installed the dependencies:
pip3 install -r requirements.txt
Features
1. Safely remove dependencies of the Odoo modules… you can either pass modules in a list from the cmd line, or you can just use a file with the modules listed in the first line of the file.
Install the package from the source
pip3 install odut
Windows:
$ odut --modules "['account', 'crm']" --base_dir 'Path to your addons'
Macos/Linux:
$ odut --modules "['account', 'crm']" --base_dir 'Path to your addons'
Deployment
Start a PostgreSQL server
$ docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name db postgres:10
Start an Odoo instance
$ docker run -p 8069:8069 --name odoo --link db:db -t odoo
(Optional)Delete unnecessary modules
$ docker exec -it --user root odoo bash $ pip3 install --upgrade pip $ pip3 install odut $ # incase of: ImportError: cannot import name 'main' $ hash -d pip3 # multiple times! $ alias odut=./var/lib/odoo/.local/bin/odut $ find . -name '*odoo*' # to find the odoo addons using find. $ # usually in this directory ./usr/lib/python3/dist-packages/odoo/addons/ $ odut --modules "['crm', 'inventory', 'sales']" --base_dir '/usr/lib/python3/dist-packages/odoo/addons/'
Stop and restart an Odoo instance
$ docker stop odoo $ docker start -a odoo
Packaging Up
Locally
Develop mode:
$ # testing locally in development mode. $ python setup.py develop $ python setup.py develop --uninstall
Editable Mode:
$ pip install -e .
This is similar to running python setup.py develop in that it installs your package using a symlink to your development code.
Packaging up to Pypi
(Optional) Bumpversion:
$ bumpversion --allow-dirty --current-version 1.4.0 minor setup.py
Create the distribution file:
$ python3 setup.py sdist bdist_wheel
run commands to check the errors:
$ twine check dist/*
Uploading to Pypi:
$ python3 -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
Re Upload to pypi
change the version number in setup.py and __init__.py file:
$ rm -r dist/ $ rm -r build/
then, redo the procedures.
Caution:dist file of same name cannot be uploaded again.
https://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/introduction.html
Test
About setup.py
python setup.py install is used to install (typically third party) packages that you’re not going to develop/modify/debug yourself.
For your own stuff, you want to first install your package and then be able to frequently edit the code without having to re-install the package every time — and that is exactly what python setup.py develop does:
it installs the package (typically just a source folder) in a way that allows you to conveniently edit your code after it’s installed to the (virtual) environment, and have the changes take effect immediately.
Note that it is highly recommended to use pip install . (install) and pip install -e . (developer install) to install packages, as invoking setup.py directly will do the wrong things for many dependencies, such as pull prereleases and incompatible package versions, or make the package hard to uninstall with pip.
Credits
History
0.1.0 (2019-06-29)
First release on PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file odut-1.6.0.tar.gz
.
File metadata
- Download URL: odut-1.6.0.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64918fb9e68cf18d693e04b6869428df4d8b8a2a600dbd31205482443994ac7e |
|
MD5 | 8cf283bf472849b969c14f77f8c6cf97 |
|
BLAKE2b-256 | d48f23235768515f370dba4e0dcdc92571884b8b570547f91acd7df5fb79b208 |
File details
Details for the file odut-1.6.0-py2.py3-none-any.whl
.
File metadata
- Download URL: odut-1.6.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcea5a49b8dc0dfa5c68c0f1dc09a4ae15a8cca5cdca4d7fb0db5ecf464f6aff |
|
MD5 | 630fca020e1dc86744ac8ea9e6e63451 |
|
BLAKE2b-256 | e9fd53425b83558ad93cd08df17fed84e2229eacc3ef93c74d2475143df13d9c |