Application integrated with the Odoo ERP initially developed to facilitate event management for the Les Grains de Sel cooperative supermarket.
- Docker
- Git
git clone https://github.com/alexandrelam/lesgrainsdesel
- Renomer le dossier
lesgrainsdesel
en un autre nom ! (Odoo ne fonctionne pas lorsque le dossier s'appellelesgrainsdesel
) - Move to the right folder
docker-compose up
- Get inside the docker container to execute the next commands
python3 manage.py migrate
python3 manage.py initadmin
this commands create a superuser with the user and password set asadmin
- Run the app and go to the admin page (
http://localhost:8000/admin/
) - Create an event and add an
adherent
(note: images field are not required thanks to default values) - Login
http://localhost:8000/login
(email=username of createsuperuser || password is password of createsuperuser) - Enjoy !
- You can access the django app using
http://localhost:8000
- You can access odoo using
http://localhost:8069
- Once you login in odoo using
admin
as the login and password, you need to install the following apps in the following order : coop-shift then coop-membership
- git
- Python3 && pip3
- Django 3
- Docker with foodcoop image
- Install git : https://phoenixnap.com/kb/how-to-install-git-windows.
- In a console/terminal configure git using
git config --global user.name "FIRST_NAME LAST_NAME"
git config --global user.email "[email protected]"
- Install python3.
- Add python to path during the installation process to use python et pip in a console/terminal.
- Optional if python and pip wasn't added to path on windows follow the next step. 3.1 Add python to path : https://geek-university.com/python/add-python-to-the-windows-path/. 3.2 Add PIP to path : https://projects.raspberrypi.org/en/projects/using-pip-on-windows/4.
- Check your installation. Try to execute the command
python
andpip
in your console/terminal.
- Move to the
django
directory usingcd django
. - Install dependancies using the command :
pip install -r requirements.txt
- Install DockerHub from : https://docs.docker.com/docker-for-windows/install/.
- Déplacez vous dans le dossier de votre choix puis clonez le répo foodcoop :
git clone https://gitlab.com/lgds/foodcoops
- Rendez-vous dans le dossier dans lequel vous avez cloné le répo foodcoop.
- Exécutez la commande
docker-compose up
pour démarrer le conteneur de l'application.
- Move to the folder
django
. python manage.py runserver
Once the foodcoop container is launched, go to http: //127.0.0.1: 8069
-
Email: admin
-
Password: admin
From there, install the coop-account and coop-shift apps.
After following these steps, you will be able to access the database with python using odoo.py
.
Creation of a first level of abstraction with the Odoo class.
from odoo import Odoo
odoo = Odoo()
# connect() permet de set les endpoints common et
# object ainsi que d'obtenir le uid
odoo.connect()
# exemple : on cherche l'evenement avec un id de 2
# et on affiche que la propriete name et
# l organisateur de l evenement
# Ne pas oublier de rajouter au moins 2 evenements
print(odoo.searchRead("event.event", [["id", "=", 2]], ["name", "organizer_id"]))
- Connection facilité
- Trouver où est situé le système de points
- Trouver comment marche l'identification des membres de la coopération et des admins sur odoo
- Bouger
odoo.py
dans une autre app django - Optimiser les images car loading trop long quand on sélectionne un événement