Metadata-Version: 2.4
Name: odoo-addon-somconnexio
Version: 16.0.1.4.0
Summary: Customizations for Som Connexió ERP.
Home-page: https://coopdevs.org
Author: Som Connexió SCCL, Coopdevs Treball SCCL
License: AGPL-3
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 16.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
Requires-Dist: factory-boy
Requires-Dist: faker==9.3.1
Requires-Dist: mm-proxy-python-client==0.1.0
Requires-Dist: odoo-addon-account_asset_management<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-account_banking_sepa_credit_transfer<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-account_banking_sepa_direct_debit<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-account_chart_update<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-account_due_list<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-account_financial_report<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-account_payment_mode<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-account_payment_order<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-account_payment_partner<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-account_payment_return<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-account_payment_return_import<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-account_payment_return_import_iso20022<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-auth_oidc<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-base_import_async<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-base_rest_somconnexio<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-component_event<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-contract<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-contract_mandate<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-contract_payment_mode<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-crm_lead_product<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-disable_login<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-l10n_es_account_asset<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-l10n_es_account_statement_import_n43<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-l10n_es_aeat<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-l10n_es_aeat_mod111<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-l10n_es_aeat_mod190<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-l10n_es_aeat_mod303<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-l10n_es_aeat_mod347<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-l10n_es_aeat_mod349<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-l10n_es_aeat_mod390<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-l10n_es_igic<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-l10n_es_mis_report<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-l10n_es_partner<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-l10n_es_toponyms<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-mail_activity_board<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-mail_activity_done<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-mis_builder<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-mis_builder_budget<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-partner_firstname<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-partner_manual_rank<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-partner_priority<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-product_pack<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-queue_job<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-server_environment<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-web_chatter_position<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-web_m2x_options<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-web_no_bubble<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-web_responsive<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-web_widget_open_tab<16.1dev,>=16.0dev
Requires-Dist: odoo<16.1dev,>=16.0a
Requires-Dist: python-stdnum==1.14
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

##########################
 SomConnexio - ERP System
##########################

.. |badge1| image:: https://codecov.io/gl/coopdevs/odoo-somconnexio/branch/master/graph/badge.svg?token=ZfxYjFpQBz
   :alt: codecov
   :target: https://codecov.io/gl/coopdevs/odoo-somconnexio

.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
   :alt: License: AGPL-3
   :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html

.. |badge3| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
   :alt: Mature
   :target: https://odoo-community.org/page/development-status

|badge1| |badge2| |badge3|

This project provides an ERP system for `Som Connexio
<https://somosconexion.coop/>`_ telecommunication users cooperative.

**************
 Installation
**************

This package requires Odoo v12.0 installed.

You can install this module using ``pip``:

.. code:: bash

   $ pip install odoo-addon-somconnexio

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

*************
 Development
*************

Configure local development environment
=======================================

First of all, to start 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:

#. Install ``pyenv``

.. code:: bash

   curl https://pyenv.run | bash

2. Build the Python version

.. code:: bash

   pyenv install 3.7.7

3. Create a virtualenv

.. code:: bash

   pyenv virtualenv 3.7.7 odoo-somconnexio

4. Activate the virtualenv

.. code:: bash

   pyenv activate odoo-somconnexio

5. Install dependencies

.. code:: bash

   pip install pre-commit

6. Install pre-commit hooks

.. code:: bash

   pyenv exec pre-commit install

Create development environment (LXC Container)
==============================================

Create the ``devenv`` container with the ``somconnexio`` module mounted
and provision it. Follow the `instructions
<https://gitlab.com/coopdevs/odoo-somconnexio-inventory#requirements>`_
in `odoo-somconnexio-inventory
<https://gitlab.com/coopdevs/odoo-somconnexio-inventory>`_.

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

.. code:: bash

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

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

.. code:: bash

   $ sudo lxc-ls -f

Start the ODOO application
==========================

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

.. code:: bash

   $ 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
<https://gitlab.com/coopdevs/odoo-somconnexio/-/blob/master/somconnexio/__manifest__.py#L3>`_
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
environment first, drop the DB, and run the odoo bin to create it again:

.. code:: bash

   $ 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
(``<USER>``), and then switch to ``odoo`` user to install with pip the
package version found in the git branch.

.. code:: bash

   $ 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.

.. code:: bash

   $ 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:

.. code:: bash

   $ ./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 next steps:

#. Copy the `coveragerc
   <https://github.com/coopdevs/maintainer-quality-tools/blob/master/cfg/.coveragerc>`_
   file in your ``odoo`` base path (``/opt/odoo``) changing the
   ``include`` option to the ``somconnexio`` module path
   (``/opt/odoo_modules/somconnexio/*``).

#. Go to ``/opt/odoo``

#. Run:

.. code:: bash

   $ 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 skipped. More info in
https://docs.gitlab.com/ee/ci/yaml/#skip-pipeline

**************
 Contributors
**************

-  ``Som Connexió SCCL <https://somconnexio.coop/>``

   -  Gerard Funonsas gerard.funosas@somconnexio.coop
   -  Borja Gimeno borja.gimeno@somconnexio.coop

-  ``Coopdevs Treball SCCL <https://coopdevs.coop/>``

   -  Daniel Palomar daniel.palomar@coopdevs.org
   -  César López cesar.lopez@coopdevs.org
