Doc, tools for lokavaluto development
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
5.4 KiB

  1. # Odoo and Lokavaluto addons installation
  2. 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.
  3. ## Table of Contents
  4. * [Make file](#Make%20file)
  5. * [Makefile content](#Makefile%20content)
  6. * [Installation](#Installation)
  7. * [Run Odoo](#Run%20Odoo)
  8. * [Activate the developer mode](#Activate%20the%20developer%20mode)
  9. * [Install the addons](#Install%20the%20addons)
  10. ## Make file
  11. The Makefile is used to download Odoo 12.0 and all of its requirements.
  12. To use it, the first step is to install make using ```sudo apt install make```.
  13. It also requires bash ```sudo apt install bash```.
  14. ### Makefile content
  15. The same Makefile is used to setup the environnement and to run.
  16. For now you have to chose the version of Odoo carefully before launching the installation.
  17. Once installed, you can not change easily Odoo's version.
  18. 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```.
  19. 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```
  20. ```Makefile
  21. .PHONY: odoo python3 pip3 postgre general-dependencies dependencies rtlcss addons run npm aptpost runodoo runfirefox initodoo
  22. SHELL := /bin/bash
  23. # make prepare
  24. prepare: python3 pip3 general-dependencies npm aptpost rtlcss
  25. python3:
  26. apt install -y python3
  27. @echo -e "python3 installation : ok \n"
  28. pip3:
  29. apt install -y python3-pip
  30. @echo -e "pip3 installation : ok \n"
  31. general-dependencies:
  32. sudo apt install -y python3-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev \
  33. libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev libfreetype6-dev \
  34. liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev libpq-dev
  35. npm:
  36. apt install -y nodejs npm
  37. rtlcss:
  38. npm install -g postcss
  39. npm install -g rtlcss
  40. aptpost:
  41. apt install -y postgresql postgresql-client
  42. # make install
  43. install: odoo postgre dependencies addons initodoo
  44. @echo -e "Installation : ok \n"
  45. .ONESHELL:
  46. odoo:
  47. @if [ ! -d "./odoo" ] ; then git clone https://github.com/odoo/odoo.git ; fi
  48. cd ./odoo
  49. # Change Odoo's version here
  50. git checkout 12.0
  51. sed -i 's/psycopg2==2.7.3.1/psycopg2==2.8.3/g' requirements.txt
  52. @echo -e "odoo download : ok \n"
  53. postgre:
  54. sudo -u postgres createuser -s $$USER
  55. createdb $$USER
  56. @echo -e "postgre installation : ok \n"
  57. .ONESHELL:
  58. dependencies:
  59. cd ./odoo;
  60. pip3 install setuptools wheel;
  61. pip3 install -r requirements.txt
  62. pip3 install watchdog
  63. .ONESHELL:
  64. addons:
  65. @if [ ! -d "./lokavaluto-addons" ] ; then git clone https://github.com/Lokavaluto/lokavaluto-addons.git ; fi
  66. cd ./lokavaluto-addons
  67. # Change Addons' version here
  68. git checkout 12.0-Exchange_counters_2
  69. @echo -e "Addons download : ok \n"
  70. .ONESHELL:
  71. initodoo:
  72. cd ./odoo
  73. python3 odoo-bin --addons-path=addons,../lokavaluto-addons -i base -d $$USER --stop-after-init
  74. # make run
  75. .ONESHELL:
  76. run: runfirefox runodoo
  77. .ONESHELL:
  78. runodoo:
  79. cd ./odoo
  80. python3 odoo-bin --addons-path=addons,../lokavaluto-addons
  81. runfirefox:
  82. firefox http://localhost:8069?debug= &
  83. ```
  84. ### Installation
  85. Create the Makefile where you want to install the environnement.
  86. 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).
  87. To install all the tools needed for the development run ```sudo make prepare``` (needs privileges).
  88. To start the installation, just run ```make install```.
  89. ### Run Odoo
  90. To launch Odoo, run ```sudo make run```.
  91. This calls a python command inside odoo's folder ```python3 odoo-bin --addons-path=addons,../lokavaluto-addons -d mydb```.
  92. The arguments ```--addons-path``` adds the defaults addons folder from Odoo 12.0 and the Lokavakuto's addons downloaded during the installation.
  93. Everything should be running without errors nor warnings.
  94. Firefox should start and open the web interface.
  95. The WEB interface should be available at [http://localhost:8069](http://localhost:8069). You can login using the user ```admin``` and the password ```admin```.
  96. ## Activate the developer mode
  97. The first way to activate the developer mode is to add ```?debug=``` to the URL : [http://localhost:8069?debug=](http://localhost:8069?debug=).
  98. Otherwise you can activate it throught the WEB interface.
  99. Login using the user ```admin``` and the password ```admin``` and go to ```Settings``` to activate the ```developer mode```.
  100. ![settings](images/settings.png)
  101. ![dev](images/dev.png)
  102. ## Install the addons
  103. Go to the ```Apps``` window and remove what is present in the ```Search``` field.
  104. ![remove](images/remove.png)
  105. Then search for your module.
  106. ![search](images/search.png)
  107. Install it by clicking on the ```Install Button```
  108. ![install](images/install.png)
  109. Wait for the module to install and check the result.
  110. ![result](images/result.png)