Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP]lcc_lokavaluto_app_connection:allow or not sending allocation to… #304

Open
wants to merge 24 commits into
base: 16.0-reconversion
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f3effe0
[IMP] lcc_lokavaluto_app_connection: create debit.request model
Jun 17, 2024
a04580e
[IMP] lcc_lokavaluto_app_connection: add commission invoices
Jun 18, 2024
e36ee76
[FIX] lcc_lokavaluto_app_connection: fix request states calculation
Jun 21, 2024
fa616ed
[IMP] lcc_lokavaluto_app_connection: add reconversion checking cron
Jun 21, 2024
3904309
[IMP] lcc_comchain_base: add reconversion checking process
Jun 21, 2024
cb63552
[IMP] lcc_cyclos_base: add reconversion checking process
Jun 21, 2024
a3b6282
[IMP] lcc_cyclos_base: add Cyclos debit wallet config
Jun 24, 2024
6c35694
[IMP] lcc_lokavaluto_app_connection: add reconversion rule
Jun 25, 2024
bc9bf88
[IMP] lcc_comchain_base: add reconversion auth in wallet json data
Jun 25, 2024
48476c9
[IMP] lcc_cyclos_base: add reconversion auth in wallet json data
Jun 25, 2024
021d88e
[IMP] lcc_lokavaluto_app_connection: add reconversions API service
Jun 25, 2024
0c39ed7
[IMP] lcc_lokavaluto_app_connection: refactor digital currency menu
Jun 25, 2024
fd17893
[CLN] global: rename res.partner.backend files in wallet
Jun 25, 2024
45dda3a
[FIX] lcc_lokavaluto_app_connection: add missing security rule
Jun 26, 2024
ebdf517
[IMP] lcc_lokavaluto_app_connection: move button in wallet form view
Jun 26, 2024
3863756
[IMP] lcc_wallet_qr: move button in wallet form view header
Jun 26, 2024
debb5ce
[I18N] lcc_lokavaluto_app_connection: update french translations
Jun 27, 2024
4571285
[I18N] lcc_comchain_base: update french translations
Jun 27, 2024
962b028
[I18N] lcc_cyclos_base: update french translations
Jun 27, 2024
2384064
[IMP] lcc_comchain_base: refactor comchain settings view
Jun 27, 2024
75028d3
[IMP] lcc_members: remove user types display in user form
Jul 18, 2024
0dcb23d
[FIX] lcc_lokavaluto_app_connection: corrects typo
Jul 19, 2024
65d68b7
[MIG] pkg: make 'demo, test, dev1, dev2, dev3' branches deploy code
Jul 19, 2024
578b384
[IMP]lcc_lokavaluto_app_connection:allow or not sending allocation to…
LaetitiaElabore Sep 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Continuous integration

## Global picture

Hosts are available through sftp (sftp is using ssh). The
authentication is the SSH one through a private key on the github side
(managed in github secrets) and accessible through
`secrets.sftp_private_key` in the yaml workflow definition.

All content of the workdir is sent to the hosts (ideally mirrored and
only difference should be sent), but this is not yet the case for
`lftp` limitation over using `sftp` and setting dates
correctly. `rclone` should be able to handle this better but is not
yet used. A simple git push could be studied also.

To trigger the restart of odoo on the host, we set up a inotify
watcher through `incron`.

## Host setup

### odoo

To add `odoo` services to a compose read host, add this section to
your `compose.yml`:

```yaml
odoo:
charm: odoo-tecnativa
docker-compose:
command:
- "--dev=xml,qweb,werkzeug"
- "--log-level=debug"
- "--limit-time-cpu=500"
- "--limit-time-real=500"
- "--limit-memory-soft=25273917440"
- "--limit-memory-hard=25273917440"
- "--addons-path=/opt/odoo/auto/lokavaluto,/opt/odoo/auto/addons"
volumes:
- /srv/datastore/data/odoo/opt/odoo/auto/lokavaluto:/opt/odoo/auto/lokavaluto:rw
image: docker.0k.io/mirror/odoo:rc_12.0-MYC-INIT-3.7
options:
workers: 4
modules:
- lcc_lokavaluto_app_connection
- lcc_comchain_base
- lcc_cyclos_base
relations:
web-proxy:
frontend:
domain: odoo.mydomain.org
```

Notice:

- the `--addons` path correlates with the `volumes` section.
- the `modules` section list the current modules

### sftp

To add `sftp` services to a compose ready host, add this section to
your `compose.yml`:

```yaml
sftp:
docker-compose:
ports:
- "10322:22"
volumes:
- /srv/datastore/data/odoo/opt/odoo/auto/lokavaluto:/home/monujo/lokavaluto-addons:rw
options:
users:
monujo:
groups:
- monujo-rw:3000
password: yLzTieeTwJmMlFZG
keys:
- "ssh-rsa AAAAB3N...PUBLICKEYGOESHERE... [email protected]"
```

The volumes section allows to `publish` and give access to the place
where odoo reads the module's code.

The public key is the public key part corresponding to the private key
that needs to be sent by the client (in github secrets).

Note that group `monujo-rw` is important. You should give the right of
all files that are to be modified the group `3000` from the host:

```
chown 1000:3000 /srv/datastore/data/odoo/opt/odoo/auto/lokavaluto -R
```

### incron

Incron is the tool used for the github deployement to signal the end
of the upload of the new files. It should trigger a restart of the
odoo docker.

Directory that allows triggering the event must be created and
permissions should be set so sftp user can write in it:

```bash
mkdir -p /srv/datastore/data/sftp/home/monujo/lokavaluto-addons.updated
cd /srv/datastore/data/sftp/home/monujo/lokavaluto-addons.updated
chown 1000:3000 -R .
```

To install `incron`:

```bash
apt-get install incron
echo "root" > /etc/incron.allow
```

To edit:

```bash
EDITOR=vim incrontab -e
```

Line to create in current installation

```
/srv/datastore/data/sftp/home/monujo/lokavaluto-addons.updated IN_CREATE,IN_MODIFY docker restart myc_odoo_1
```

It is expected that the client will delete and add a file in folder:
`lokavaluto-addons.updated` to trigger the reload.

54 changes: 54 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "🚀 deploy CI"
on:
push:
branches:
- demo
- test
- dev1
- dev2
- dev3
paths-ignore:
- 'README*'

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: 🚚 Get code
uses: actions/checkout@v2

## XXXvlab: contrary two what was expected from ltfp in mirror
## mode, this setup is highly inefficient: because through sftp,
## lftp is not able to set correctly dates so it just delete and
## rewrite everything on the other end. We need to change that
## with ``rclone`` solution I guess if we don't want to change
## ``sftp`` protocol.
- name: "📂 SFTP Sync files"
uses: swillner/[email protected]
with:
server: ${{ github.ref_name }}.lokavaluto.fr
port: 10322
user: monujo
user_private_key: ${{ secrets.sftp_private_key }}
host_public_key:
local: ./
remote: /lokavaluto-addons
mirror_options: "--exclude-glob=.git*/ --verbose"
## This part is to ensure that we can trigger actions after
## the sync occured on the destination host.
- name: 🔨 Prepare last-updated
run: |
mkdir last-updated
date > last-updated/done
- name: "📂 SFTP Send last-updated"
uses: swillner/[email protected]
with:
server: ${{ github.ref_name }}.lokavaluto.fr
port: 10322
user: monujo
user_private_key: ${{ secrets.sftp_private_key }}
host_public_key:
local: ./last-updated
remote: /lokavaluto-addons.updated
mirror_options: "--verbose"
2 changes: 1 addition & 1 deletion lcc_comchain_base/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"data": [
"security/ir_rule.xml",
"views/res_config_settings_view.xml",
"views/lcc_backend.xml",
"views/wallet.xml",
"data/comchain_data.xml",
],
# only loaded in demonstration mode
Expand Down
100 changes: 62 additions & 38 deletions lcc_comchain_base/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -1,37 +1,57 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * lcc_comchain_base
# * lcc_comchain_base
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-12-11 21:24+0000\n"
"PO-Revision-Date: 2023-12-11 21:24+0000\n"
"Last-Translator: <>\n"
"POT-Creation-Date: 2024-06-27 08:59+0000\n"
"PO-Revision-Date: 2024-06-27 08:59+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: lcc_comchain_base
#: model_terms:ir.ui.view,arch_db:lcc_comchain_base.res_config_settings_view_form_comchain
msgid "<span class=\"o_form_label\">Comchain Last block checked</span>"
msgstr "<span class=\"o_form_label\">Dernier bloc Comchain vérifié</span>"

#. module: lcc_comchain_base
#: model_terms:ir.ui.view,arch_db:lcc_comchain_base.res_config_settings_view_form_comchain
msgid "<span class=\"o_form_label\">Comchain Odoo wallet</span>"
msgstr "<span class=\"o_form_label\">PPortefeuille Comchain Odoo</span>"

#. module: lcc_comchain_base
#: model_terms:ir.ui.view,arch_db:lcc_comchain_base.res_config_settings_view_form_comchain
msgid "<span class=\"o_form_label\">Comchain Safe wallet</span>"
msgstr "<span class=\"o_form_label\">Portefeuille Comchain Coffre-Fort</span>"

#. module: lcc_comchain_base
#: model_terms:ir.ui.view,arch_db:lcc_comchain_base.res_config_settings_view_form_comchain
msgid "<span class=\"o_form_label\">Comchain currency name</span>"
msgstr "<span class=\"o_form_label\">Nom de la monnaie Comchain</span>"

#. module: lcc_comchain_base
#: model_terms:ir.ui.view,arch_db:lcc_comchain_base.res_config_settings_view_form_comchain
msgid "<span class=\"o_form_label\">Comchain top-up messages</span>"
msgstr "<span class=\"o_form_label\">Messages de recharge Comchain</span>"

#. module: lcc_comchain_base
#: model:ir.model.fields,field_description:lcc_comchain_base.field_res_partner_backend__comchain_id
msgid "Address"
msgstr "Adresse"

#. module: lcc_comchain_base
#: selection:res.partner.backend,comchain_type:0
#: model:ir.model.fields.selection,name:lcc_comchain_base.selection__res_partner_backend__comchain_type__2
msgid "Admin"
msgstr ""

#. module: lcc_comchain_base
#: selection:res.partner.backend,type:0
#: model:ir.model.fields.selection,name:lcc_comchain_base.selection__res_partner_backend__type__comchain
msgid "Comchain"
msgstr ""

Expand All @@ -46,7 +66,7 @@ msgid "Comchain service configuration"
msgstr "Configuration de Comchain"

#. module: lcc_comchain_base
#: model_terms:ir.ui.view,arch_db:lcc_comchain_base.lcc_backend_comchain_form_view
#: model_terms:ir.ui.view,arch_db:lcc_comchain_base.wallet_comchain_form_view
msgid "Comchain specific"
msgstr "Spécifique Comchain"

Expand All @@ -56,14 +76,14 @@ msgid "Companies"
msgstr "Sociétés"

#. module: lcc_comchain_base
#: selection:res.partner.backend,comchain_type:0
#: model:ir.model.fields.selection,name:lcc_comchain_base.selection__res_partner_backend__comchain_type__1
msgid "Company"
msgstr "Société"

#. module: lcc_comchain_base
#: model:ir.model,name:lcc_comchain_base.model_res_config_settings
msgid "Config Settings"
msgstr "Paramètres de config"
msgstr "Paramètres de configuration"

#. module: lcc_comchain_base
#: model:ir.model,name:lcc_comchain_base.model_res_partner
Expand All @@ -86,27 +106,39 @@ msgid "Currency name"
msgstr "Nom de la monnaie"

#. module: lcc_comchain_base
#: model:ir.model,name:lcc_comchain_base.model_account_invoice
msgid "Invoice"
msgstr "Facture"
#: model:ir.model.fields,field_description:lcc_comchain_base.field_res_company__last_block_checked_nb
#: model:ir.model.fields,field_description:lcc_comchain_base.field_res_config_settings__last_block_checked_nb
msgid "Last Block Checked Nb"
msgstr "Nb dernier bloc vérifié"

#. module: lcc_comchain_base
#: model:ir.model.fields,field_description:lcc_comchain_base.field_res_partner_backend__comchain_credit_max
msgid "Max Credit limit"
msgstr "Crédit max"

#. module: lcc_comchain_base
#: model:ir.model.fields,field_description:lcc_comchain_base.field_res_company__message_from
#: model:ir.model.fields,field_description:lcc_comchain_base.field_res_config_settings__message_from
msgid "Message from"
msgstr "Message de"

#. module: lcc_comchain_base
#: model:ir.model.fields,field_description:lcc_comchain_base.field_res_partner_backend__comchain_message_key
msgid "Message keys"
msgstr "Clés de message"

#. module: lcc_comchain_base
#: model:ir.model.fields,field_description:lcc_comchain_base.field_res_company__message_to
#: model:ir.model.fields,field_description:lcc_comchain_base.field_res_config_settings__message_to
msgid "Message to"
msgstr "Message à"

#. module: lcc_comchain_base
#: model:ir.model.fields,field_description:lcc_comchain_base.field_res_partner_backend__comchain_credit_min
msgid "Min Credit limit"
msgstr "Crédit min"

#. module: lcc_comchain_base
#: model:product.product,name:lcc_comchain_base.product_product_comchain
#: model:product.template,name:lcc_comchain_base.product_product_comchain_product_template
msgid "Numeric LCC (comchain)"
msgstr "MLC Numérique (comchain)"
Expand All @@ -124,7 +156,7 @@ msgid "Odoo wallet password"
msgstr "Mot de pass du portefeuille Odoo"

#. module: lcc_comchain_base
#: selection:res.partner.backend,comchain_type:0
#: model:ir.model.fields.selection,name:lcc_comchain_base.selection__res_partner_backend__comchain_type__0
msgid "Personal"
msgstr "Personnel"

Expand All @@ -146,38 +178,30 @@ msgstr "Sélectionner le contact lié au portefeuille Coffre-fort"

#. module: lcc_comchain_base
#: model_terms:ir.ui.view,arch_db:lcc_comchain_base.res_config_settings_view_form_comchain
msgid "Select the partners linked to the Safe and Odoo wallets. The\n"
" name of these partners will be displayed as the sender of the\n"
" top-up."
msgstr "Sélectionner les contacts liés aux portefeuilles Coffre-fort et Odoo. Les\n"
" noms de ces contacts seront affichés comme source des\n"
" chargements."

#. module: lcc_comchain_base
#: model:ir.model.fields,field_description:lcc_comchain_base.field_res_partner_backend__comchain_type
#: model:ir.model.fields,field_description:lcc_comchain_base.field_res_partner_backend__type
msgid "Type"
msgid ""
"Select the partner linked to the Safe wallet.\n"
" This wallet will be used for top up and reconversion\n"
" processes."
msgstr ""
"Sélectionner le contact lié au portefeuille Coffre-Fort.\n"
" Ce porteeuille sera utilisé pour les chargements et les reconversions."

#. module: lcc_comchain_base
#: model:product.product,uom_name:lcc_comchain_base.product_product_comchain
#: model:product.template,uom_name:lcc_comchain_base.product_product_comchain_product_template
msgid "Unit(s)"
msgstr "Unité(s)"

#. module: lcc_comchain_base
#: model:product.category,name:lcc_comchain_base.product_category_comchain
msgid "comchain"
#: model_terms:ir.ui.view,arch_db:lcc_comchain_base.res_config_settings_view_form_comchain
msgid ""
"Select the partners linked to the Odoo wallet, that has the\n"
" delegation to perform top-ups from the safe wallet."
msgstr ""
"Sélectionner le contact lié au portefeuille de Odoo, qui a la\n"
" procuration pour réaliser des chargements depuis le portefeuille Coffre-fort."

#. module: lcc_comchain_base
#: model:product.product,weight_uom_name:lcc_comchain_base.product_product_comchain
#: model:product.template,weight_uom_name:lcc_comchain_base.product_product_comchain_product_template
msgid "kg"
#: model:ir.model.fields,field_description:lcc_comchain_base.field_res_partner_backend__comchain_type
#: model:ir.model.fields,field_description:lcc_comchain_base.field_res_partner_backend__type
msgid "Type"
msgstr ""

#. module: lcc_comchain_base
#: model:ir.model,name:lcc_comchain_base.model_res_partner_backend
msgid "res.partner.backend"
msgstr ""

Loading