dev #2

Closed
Ghost wants to merge 10 commits from <deleted>:dev into dev
  1. 8
      README.org
  2. BIN
      images/dev.png
  3. BIN
      images/install.png
  4. BIN
      images/remove.png
  5. BIN
      images/result.png
  6. BIN
      images/search.png
  7. BIN
      images/settings.png
  8. 170
      makefile-installation.md

8
README.org

@ -45,7 +45,7 @@ We are using =compose=, and installation process will download
**** Requirements
- =bash= >= 4.3
- =docker= >= 17.06
- =docker= >= 17.06 ## Install it using the official version: https://docs.docker.com/engine/install/ubuntu/
- =curl= ## for installation
- =git=
@ -178,12 +178,12 @@ curl -sS https://git.myceliandre.fr/Lokavaluto/dev-pack/raw/branch/dev/src/insta
This method only works if you are on linux, MacOSX, or Windows WSL2
with docker installed inside WSL2.
You need to create a =compose.yml= that suits your need. You can
You need to create a =compose.yml= that suits your needs. You can
create it wherever you want. We would recommend you to create a
sub-directory for your project named "lokavaluto" for instance, and
place the =compose.yml= inside. Here's a good way to create the
compose file, once you are in the correct directory, you can execute
these command in a shell:
this command in a shell:
#+BEGIN_SRC shell
cat <<EOF > compose.yml
@ -256,7 +256,7 @@ ODOO_IP=$(docker-ip | grep odoo | sed -r 's/ +/ /g' | cut -f 3 -d " ")
echo "Odoo is up and running on: http://$ODOO_IP:8069"
#+END_SRC
If your setup allow direct access from the host running your browser
If your setup allows direct access from the host running your browser
to the container's network, then you can point your browser towards
the given address.

BIN
images/dev.png

After

Width: 636  |  Height: 359  |  Size: 31 KiB

BIN
images/install.png

After

Width: 322  |  Height: 124  |  Size: 14 KiB

BIN
images/remove.png

After

Width: 210  |  Height: 54  |  Size: 3.7 KiB

BIN
images/result.png

After

Width: 157  |  Height: 241  |  Size: 12 KiB

BIN
images/search.png

After

Width: 282  |  Height: 106  |  Size: 9.0 KiB

BIN
images/settings.png

After

Width: 126  |  Height: 223  |  Size: 12 KiB

170
makefile-installation.md

@ -0,0 +1,170 @@
# Odoo and Lokavaluto addons installation
This document details the installation of Odoo 12.0 plus the addons created by Lokavaluto available here: [https://github.com/Lokavaluto/lokavaluto-addons](https://github.com/Lokavaluto/lokavaluto-addons). In this installation, we use the branch ```12.0-Exchange_counters_2```. To use anther branch, just change the command in the MakeFile.
## Table of Contents
* [Make file](#Make%20file)
* [Makefile content](#Makefile%20content)
* [Installation](#Installation)
* [Run Odoo](#Run%20Odoo)
* [Activate the developer mode](#Activate%20the%20developer%20mode)
* [Install the addons](#Install%20the%20addons)
* [Lint](#Lint)
## Make file
The Makefile is used to download Odoo 12.0 and all of its requirements.
To use it, the first step is to install make using ```sudo apt install make```.
It also requires bash ```sudo apt install bash```.
### Makefile content
The same Makefile is used to setup the environnement and to run.
For now you have to chose the version of Odoo carefully before launching the installation.
Once installed, you can not change easily Odoo's version.
So if you do not want to use the version 12.0 as Lokavaluto does, change it in the Makefile just after the comment ```Change Odoo's version here```.
For Lokavaluto's addons, you can chose the branch in the Makefile after the comment ```Change Addons' version here```. If you wan to change the branch after the installation, you can rerun the installation or switch branch in the git folder using ```git checkout branch_name```
```Makefile
.PHONY: odoo python3 pip3 postgre general-dependencies dependencies rtlcss addons run npm aptpost runodoo runfirefox initodoo lintinstall
SHELL := /bin/bash
# make prepare
prepare: python3 pip3 general-dependencies npm aptpost rtlcss
python3:
apt install -y python3
@echo -e "python3 installation : ok \n"
pip3:
apt install -y python3-pip
@echo -e "pip3 installation : ok \n"
general-dependencies:
sudo apt install -y python3-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev \
libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev libfreetype6-dev \
liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev libpq-dev
npm:
apt install -y nodejs npm
rtlcss:
npm install -g postcss
npm install -g rtlcss
aptpost:
apt install -y postgresql postgresql-client
# make install
install: odoo postgre dependencies addons initodoo lintinstall
@echo -e "Installation : ok \n"
.ONESHELL:
odoo:
@if [ ! -d "./odoo" ] ; then git clone https://github.com/odoo/odoo.git ; fi
cd ./odoo
# Change Odoo's version here
git checkout 12.0
sed -i 's/psycopg2==2.7.3.1/psycopg2==2.8.3/g' requirements.txt
@echo -e "odoo download : ok \n"
postgre:
sudo -u postgres createuser -s $$USER
createdb $$USER
@echo -e "postgre installation : ok \n"
.ONESHELL:
dependencies:
cd ./odoo;
pip3 install setuptools wheel;
pip3 install -r requirements.txt
pip3 install watchdog
pip3 install phonenumbers
.ONESHELL:
addons:
@if [ ! -d "./lokavaluto-addons" ] ; then git clone https://github.com/Lokavaluto/lokavaluto-addons.git ; fi
cd ./lokavaluto-addons
# Change Addons' version here
git checkout 12.0-Exchange_counters_2
@echo -e "Addons download : ok \n"
.ONESHELL:
initodoo:
cd ./odoo
python3 odoo-bin --addons-path=addons,../lokavaluto-addons -i base,l10n_fr -d $$USER --stop-after-init
lintinstall:
pip3 install pylint-odoo
# make run
.ONESHELL:
run: runfirefox runodoo
# -u : Upgrade specified modules on restart
# --dev all : restart server on py change
# --log-handler : Adds more information in log
.ONESHELL:
runodoo:
cd ./odoo
python3 odoo-bin --addons-path=addons,../lokavaluto-addons -u lcc_exchange_counters --dev all --log-handler :DEBUG
runfirefox:
firefox http://localhost:8069?debug= &
# make lint
lint:
pylint --load-plugins=pylint_odoo -d all -e odoolint lokavaluto-addons/*
```
### Installation
Create the Makefile where you want to install the environnement.
After the installation, 2 folders are created ```lokavaluto-addons``` and ```odoo``` containing respectively Lokavaluto's addons and Odoo's source files. The script installs the latest version of Python3, pip3, and postgresql. It also downloads all the dependencies listed here: [https://www.odoo.com/documentation/12.0/setup/install.html#id7](https://www.odoo.com/documentation/12.0/setup/install.html#id7).
To install all the tools needed for the development run ```sudo make prepare``` (needs privileges).
To start the installation, just run ```make install```.
### Run Odoo
To launch Odoo, run ```sudo make run```.
This calls a python command inside odoo's folder ```python3 odoo-bin --addons-path=addons,../lokavaluto-addons -d mydb```.
The arguments ```--addons-path``` adds the defaults addons folder from Odoo 12.0 and the Lokavakuto's addons downloaded during the installation.
Everything should be running without errors nor warnings.
Firefox should start and open the web interface.
The WEB interface should be available at [http://localhost:8069](http://localhost:8069). You can login using the user ```admin``` and the password ```admin```.
## Activate the developer mode
The first way to activate the developer mode is to add ```?debug=``` to the URL : [http://localhost:8069?debug=](http://localhost:8069?debug=).
Otherwise you can activate it throught the WEB interface.
Login using the user ```admin``` and the password ```admin``` and go to ```Settings``` to activate the ```developer mode```.
![settings](images/settings.png)
![dev](images/dev.png)
## Install the addons
Go to the ```Apps``` window and remove what is present in the ```Search``` field.
![remove](images/remove.png)
Then search for your module.
![search](images/search.png)
Install it by clicking on the ```Install Button```
![install](images/install.png)
Wait for the module to install and check the result.
![result](images/result.png)
## Lint
Use the official Odoo linter: [https://github.com/OCA/pylint-odoo](https://github.com/OCA/pylint-odoo)
```make lint```
Loading…
Cancel
Save