Browse Source

update to separate command using sudo

pull/2/head
Cédric Herzog 4 years ago
parent
commit
8335cfae4e
  1. 78
      makefile-installation.md

78
makefile-installation.md

@ -1,5 +1,5 @@
# Odoo and Lokavaluto addons installation # Odoo and Lokavaluto addons installation
This document details the installation of Odoo 12.0 plus the addons created by Lokavaluto and 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.
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 ## Table of Contents
* [Make file](#Make%20file) * [Make file](#Make%20file)
@ -23,10 +23,39 @@ So if you do not want to use the version 12.0 as Lokavaluto does, change it in t
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``` 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 ```Makefile
.PHONY: odoo python3 pip3 postgre general-dependencies dependencies rtlcss addons run
.PHONY: odoo python3 pip3 postgre general-dependencies dependencies rtlcss addons run npm aptpost runodoo runfirefox initodoo
SHELL := /bin/bash SHELL := /bin/bash
install: odoo python3 pip3 postgre general-dependencies dependencies rtlcss addons
# 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
@echo -e "Installation : ok \n" @echo -e "Installation : ok \n"
.ONESHELL: .ONESHELL:
@ -38,36 +67,18 @@ odoo:
sed -i 's/psycopg2==2.7.3.1/psycopg2==2.8.3/g' requirements.txt sed -i 's/psycopg2==2.7.3.1/psycopg2==2.8.3/g' requirements.txt
@echo -e "odoo download : ok \n" @echo -e "odoo download : ok \n"
python3:
apt install -y python3
@echo -e "python3 installation : ok \n"
pip3:
apt install -y python3-pip
@echo -e "pip3 installation : ok \n"
postgre: postgre:
apt install -y postgresql postgresql-client
sudo -u postgres createuser -s $$USER sudo -u postgres createuser -s $$USER
createdb $$USER createdb $$USER
@echo -e "postgre installation : ok \n" @echo -e "postgre 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
.ONESHELL: .ONESHELL:
dependencies: dependencies:
cd ./odoo; cd ./odoo;
pip3 install setuptools wheel; pip3 install setuptools wheel;
pip3 install -r requirements.txt pip3 install -r requirements.txt
rtlcss:
apt install -y nodejs npm
npm install -g postcss
npm install -g rtlcss
.ONESHELL: .ONESHELL:
addons: addons:
@if [ ! -d "./lokavaluto-addons" ] ; then git clone https://github.com/Lokavaluto/lokavaluto-addons.git ; fi @if [ ! -d "./lokavaluto-addons" ] ; then git clone https://github.com/Lokavaluto/lokavaluto-addons.git ; fi
@ -77,16 +88,30 @@ addons:
@echo -e "Addons download : ok \n" @echo -e "Addons download : ok \n"
.ONESHELL: .ONESHELL:
run:
initodoo:
cd ./odoo
python3 odoo-bin --addons-path=addons,../lokavaluto-addons -i base -d admin --stop-after-init
# make run
.ONESHELL:
run: runfirefox runodoo
.ONESHELL:
runodoo:
cd ./odoo cd ./odoo
python3 odoo-bin --addons-path=addons,../lokavaluto-addons python3 odoo-bin --addons-path=addons,../lokavaluto-addons
runfirefox:
firefox http://localhost:8069?debug= &
``` ```
### Installation ### Installation
Create the Makedile where you want to install the environnement.
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). 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 start the installation, just run ```sudo make install```.
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 ### Run Odoo
@ -96,9 +121,14 @@ The arguments ```--addons-path``` adds the defaults addons folder from Odoo 12.0
Everything should be running without errors nor warnings. 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```. 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 ## 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```. Login using the user ```admin``` and the password ```admin``` and go to ```Settings``` to activate the ```developer mode```.
![settings](images/settings.png) ![settings](images/settings.png)

Loading…
Cancel
Save