Skip to main content

Odoo Som Connexió customizations

Project description

codecov License: AGPL-3 Mature

This project provides an ERP system for Som Connexio telecommunication users cooperative.

Installation

This package requires Odoo v12.0 installed.

You can install this module using pip:

$ pip install odoo12-addon-somconnexio

More info in: https://pypi.org/project/odoo12-addon-somconnexio/

DEVELOPMENT

Configure local development environment

First of all, to start to development, we need to create a virtualenv in our local machine to install the pre-commit dependencies. Using a virtualenv with Python 3.7, we install the pre-commit hooks to execute the linters (and in the future the formatter).

In your local environment, where you execute the git commit ... command, run:

  1. Install pyenv
curl https://pyenv.run | bash
  1. Build the Python version
pyenv install  3.7.7
  1. Create a virtualenv
pyenv virtualenv 3.7.7 odoo-somconnexio
  1. Activate the virtualenv
pyenv activate odoo-somconnexio
  1. Install dependencies
pip install pre-commit
  1. Install pre-commit hooks
pyenv exec pre-commit install

Create development enviornment (LXC Container)

Create the devenv container with the somconnexio module mounted and provision it. Follow the instructions in odoo-somconnexio-inventory.

Once created, we can stop or start our odoo-sc lxc container as indicated here:

$ sudo systemctl start lxc@odoo-sc
$ sudo systemctl stop lxc@odoo-sc

To check our local lxc containers and their status, run:

$ sudo lxc-ls -f

Start the ODOO application

Enter to your local machine as the user odoo, activate the python enviornment first and run the odoo bin:

$ ssh odoo@odoo-sc.local
$ pyenv activate odoo
$ cd /opt/odoo
$ set -a && source /etc/default/odoo && set +a
$ ./odoo-bin -c /etc/odoo/odoo.conf -u somconnexio -d odoo --workers 0

To use the local somconnexio module (development version) instead of the PyPI published one, you need to upgrade the version in the manifest and then update the module with -u in the Odoo CLI.

Restart ODOO database from scratch

Enter to your local machine as the user odoo, activate the python enviornment first, drop the DB, and run the odoo bin to create it again:

$ ssh odoo@odoo-sc.local
$ pyenv activate odoo
$ dropdb odoo
$ cd /opt/odoo
$ ./odoo-bin -c /etc/odoo/odoo.conf -i somconnexio -d odoo --stop-after-init

Deploy branch

For tests purposes, we might want to deploy a given branch (BRANCH) into a server (staging), instead of publishing a new package release just to test some fix or new feature.

To do so, we need to enter into the server with an authorized user (), and then switch to odoo user to install with pip the package version found in the git branch.

$ ssh <USER>@staging-odoo.somconnexio.coop
$ sudo su - odoo
$ cd /opt/odoo
$ pyenv activate odoo
$ pip install -e git+https://gitlab.com/coopdevs/odoo-somconnexio@<BRANCH>#egg=odoo12-addon-somconnexio\&subdirectory=setup/somconnexio

At this point we need to restart Odoo to load the new installed module version.

$ sudo systemctl stop odoo
$ ./odoo-bin -c /etc/odoo/odoo.conf -u somconnexio -d odoo --stop-after-init --logfile /dev/stdout
$ sudo systemctl start odoo

To restart the odoo service it is better to stop it, execute odoo with the upgrade (-u) option and start it again, rather that just restart it, in case there are changes in views within the deployed branch.

Run tests

You can run the tests with this command:

$ ./odoo-bin -c /etc/odoo/odoo.conf -u somconnexio -d odoo --stop-after-init --test-enable --workers 0

The company data is rewritten every module upgrade

Run tests with coverage

You can run the tests with a coverage report following the nexts steps:

  1. Copy the .coveragerc file in your odoo base path (/opt/odoo) changing the include option to the somconnexio module path (/opt/odoo_modules/somconnexio/*).
  2. Go to /opt/odoo
  3. Run:
$ coverage run odoo-bin -c /etc/odoo/odoo.conf -u somconnexio -d odoo --stop-after-init --test-enable --workers 0 && coverage report --show-missing

Update CHANGELOG without running pipeline

If you need to update the CHANGELOG but you don't need to wait for the pipeline to end, you can put [skip ci] in your commit message and the pipeline will be skiped. More info in https://docs.gitlab.com/ee/ci/yaml/#skip-pipeline

Credits

Authors
  • Coopdevs Treball SCCL
  • Som Connexió SCCL
Contributors
  • Coopdevs Treball SCCL
  • Som Connexió SCCL

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

odoo-addon-somconnexio-16.0.1.0.6.tar.gz (506.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

odoo_addon_somconnexio-16.0.1.0.6-py2.py3-none-any.whl (625.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file odoo-addon-somconnexio-16.0.1.0.6.tar.gz.

File metadata

  • Download URL: odoo-addon-somconnexio-16.0.1.0.6.tar.gz
  • Upload date:
  • Size: 506.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for odoo-addon-somconnexio-16.0.1.0.6.tar.gz
Algorithm Hash digest
SHA256 485eab209f1003365f872b0c02c6da2430e23bff3cf1427d985940f97acdc73d
MD5 f9cbff6d1a0903bb85df3061fe91b91e
BLAKE2b-256 fe0689cb84ca65ef8199ac92b071e1de6be625072e9caef828eac5b2784d3200

See more details on using hashes here.

File details

Details for the file odoo_addon_somconnexio-16.0.1.0.6-py2.py3-none-any.whl.

File metadata

  • Download URL: odoo_addon_somconnexio-16.0.1.0.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 625.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for odoo_addon_somconnexio-16.0.1.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 272cbd3f6b5d4e3240862e55c8318c61723f680fd6a2a819503243d9ad09ed11
MD5 8d72e12541219719cd39574a6e69d58e
BLAKE2b-256 69bdb67e4f953ec70753b5dcbcb416f52e06bdb29b184bc7045dac6e56f99f2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page