How to do it...

To install Odoo from a source, you need to follow these steps:

  1. Run the following commands to install the main dependencies:
$ sudo apt-get update
$ sudo apt-get install -y git python3.5 postgresql nano virtualenv xz-utils wget fontconfig libfreetype6 libx11-6 libxext6 libxrender1 xfonts-75dpi
Odoo v12 has moved from less to scss for stylesheet preprocessing. Consequently, if you are using <v12, then you need to install node-less node-clean-css in order to get the correct stylesheets.
  1. Download and install wkhtmltopdf:
$ wget -O wkhtmltox.tar.xz  https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz 
$ tar xvf wkhtmltox.tar.xz
$ sudo mv wkhtmltox/lib/* /usr/local/lib/
$ sudo mv wkhtmltox/bin/* /usr/local/bin/
$ sudo mv wkhtmltox/share/man/man1 /usr/local/share/man/
  1. Now, use the following code to install the build dependencies:
$ sudo apt-get install -y gcc python3.5-dev libxml2-dev 
libxslt1-dev libevent-dev libsasl2-dev libssl1.0-dev libldap2-dev
libpq-dev libpng-dev libjpeg-dev
  1. Configure PostgreSQL:
$ sudo -u postgres createuser --createdb $(whoami)
$ createdb $(whoami)
  1. Configure git:
$ git config --global user.name "Your Name"
$ git config --global user.email [email protected]
  1. Clone the Odoo code base:
$ mkdir ~/odoo-dev
$ cd ~/odoo-dev
$ git clone -b 12.0 --single-branch https://github.com/odoo/odoo.git
$ cd odoo
  1. Create an odoo-12.0 virtual environment and activate it:
$ virtualenv -p python3 ~/odoo-12.0
$ source ~/odoo-12.0/bin/activate
  1. Install the Python dependencies of Odoo in virtualenv:
$ pip3 install -r requirements.txt
  1. Create and start your first Odoo instances:
$ createdb odoo-test
$ python3 odoo-bin -d odoo-test --addons-path=addons
--db-filter=odoo-test$

  1. Point your browser to http://localhost:8069 and authenticate it by using the admin account and using admin as the password.
You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files emailed to you directly.

You can download the code files by following these steps:

  1. Log in or register on our website using your email address and password
  2. Hover the mouse pointer over the SUPPORT tab at the top
  3. Click on Code Downloads and Errata
  4. Enter the title of this book in the search box
  5. Select the book that you're looking to download the code files for
  6. Choose where you purchased this book from in the drop-down menu
  7. Click on Code Download

You can also download the code files by clicking on the Code Files button on this book's web page on the Packt Publishing website. This page can be accessed by entering this book's title in the search box. Note that you need to be logged into your Packt account to do this.

Once the file has been downloaded, ensure that you unzip or extract the folder using the latest version of the following tool:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip / UnRarX for Mac
  • 7-Zip/PeaZip for Linux

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset