Book Image

Odoo Development Essentials

Book Image

Odoo Development Essentials

Overview of this book

Table of Contents (17 chapters)
Odoo Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Installing Odoo from source


Ready-to-install Odoo packages can be found at nightly.odoo.com, available as Windows (.exe), Debian (.deb), CentOS (.rpm), and source code tarballs (.tar.gz).

As developers, we will prefer installing directly from the GitHub repository. This will end up giving us more control over versions and updates.

To keep things tidy, let's work in an /odoo-dev directory inside your home directory. Throughout the book, we will assume this is where your Odoo server is installed.

First, make sure you are logged in as the user created above, or during the installation process, and not as root. Assuming your user is odoo, you can confirm this with the following command:

$ whoami
odoo
$ echo $HOME
/home/odoo

Now we can use this script. It shows us how to install Odoo from source in a Debian system:

$ sudo apt-get update && sudo apt-get upgrade  # Install system updates
$ sudo apt-get install git  # Install Git
$ mkdir ~/odoo-dev  # Create a directory to work in
$ cd ~/odoo-dev  # Go into our work directory
$ git clone https://github.com/odoo/odoo.git -b 8.0  # Get Odoo source code
$ ./odoo/odoo.py setup_deps  # Installs Odoo system dependencies
$ ./odoo/odoo.py setup_pg  # Installs PostgreSQL & db superuser for unix user

At the end, Odoo should be ready to be used. The ~ symbol is a shortcut for your home directory (for example, /home/odoo). The git -b 8.0 option asks to explicitly download the 8.0 branch of Odoo. At the time of writing this book, this is redundant, since 8.0 is the default branch, but this may change, so it will make the script time resilient.

To start an Odoo server instance, just run odoo.py:

$ ~/odoo-dev/odoo/odoo.py

By default, Odoo instances listen from port 8069, so if we point a browser to http://<server-address>:8069 we will reach that instance. When we are accessing it for the first time, it will show us an assistant to create a new database, as shown in the following screenshot:

But we will learn how to initialize new databases from the command line, now so press Ctrl + C to stop the server and get back to the command prompt.