Package: odoo12-addon-somconnexio
This project provides an ERP system forSom Connexiotelecommunication users cooperative.InstallationThis package requires Odoo v12.0 installed.You can install this module usingpip:$pipinstallodoo12-addon-somconnexioMore info in:https://pypi.org/project/odoo12-addon-somconnexio/DEVELOPMENTConfigure local development environmentFirst 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 thegit commit ...command, run:Installpyenvcurlhttps://pyenv.run|bashBuild the Python versionpyenvinstall3.7.7Create a virtualenvpyenvvirtualenv3.7.7odoo-somconnexioActivate the virtualenvpyenvactivateodoo-somconnexioInstall dependenciespipinstallpre-commitInstall pre-commit hookspyenvexecpre-commitinstallCreate development enviornment (LXC Container)Create thedevenvcontainer with thesomconnexiomodule mounted and provision it. Follow theinstructionsinodoo-somconnexio-inventory.Once created, we can stop or start ourodoo-sclxc container as indicated here:$sudosystemctlstartlxc@odoo-sc
$sudosystemctlstoplxc@odoo-scTo check our local lxc containers and their status, run:$sudolxc-ls-fStart the ODOO applicationEnter to your local machine as the userodoo, activate the python enviornment first and run the odoo bin:$sshodoo@odoo-sc.local
$pyenvactivateodoo
$cd/opt/odoo
$set-a&&source/etc/default/odoo&&set+a
$./odoo-bin-c/etc/odoo/odoo.conf-usomconnexio-dodoo--workers0To use the local somconnexio module (development version) instead of the PyPI published one, you need to upgrade theversion in the manifestand then update the module with-uin the Odoo CLI.Restart ODOO database from scratchEnter to your local machine as the userodoo, activate the python enviornment first, drop the DB, and run the odoo bin to create it again:$sshodoo@odoo-sc.local
$pyenvactivateodoo
$dropdbodoo
$cd/opt/odoo
$./odoo-bin-c/etc/odoo/odoo.conf-isomconnexio-dodoo--stop-after-initDeploy branchFor 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 toodoouser to install with pip the package version found in the git branch.$ssh<USER>@staging-odoo.somconnexio.coop
$sudosu-odoo
$cd/opt/odoo
$pyenvactivateodoo
$pipinstall-egit+https://gitlab.com/coopdevs/odoo-somconnexio@<BRANCH>#egg=odoo12-addon-somconnexio\&subdirectory=setup/somconnexioAt 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 odooTo restart the odoo service it is better to stop it, execute odoo with the upgrade (-u) option and start it again, rather that justrestartit, in case there are changes in views within the deployed branch.Run testsYou can run the tests with this command:$./odoo-bin-c/etc/odoo/odoo.conf-usomconnexio-dodoo--stop-after-init--test-enable--workers0The company data is rewritten every module upgradeRun tests with coverageYou can run the tests with a coverage report following the nexts steps:Copy the.coveragercfile in yourodoobase path (/opt/odoo) changing theincludeoption to thesomconnexiomodule path (/opt/odoo_modules/somconnexio/*).Go to/opt/odooRun:$coveragerunodoo-bin-c/etc/odoo/odoo.conf-usomconnexio-dodoo--stop-after-init--test-enable--workers0&&coveragereport--show-missingUpdate CHANGELOG without running pipelineIf 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 inhttps://docs.gitlab.com/ee/ci/yaml/#skip-pipelineCreditsAuthorsCoopdevs Treball SCCLSom Connexió SCCLContributorsCoopdevs Treball SCCLSom Connexió SCCL