Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Odoo 10 Development Essentials

You're reading from   Odoo 10 Development Essentials Explore the functionalities of Odoo to build powerful business applications.

Arrow left icon
Product type Paperback
Published in Nov 2016
Publisher Packt
ISBN-13 9781785884887
Length 298 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Daniel Reis Daniel Reis
Author Profile Icon Daniel Reis
Daniel Reis
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Getting Started with Odoo Development FREE CHAPTER 2. Building Your First Odoo Application 3. Inheritance – Extending Existing Applications 4. Module Data 5. Models – Structuring the Application Data 6. Views - Designing the User Interface 7. ORM Application Logic – Supporting Business Processes 8. Writing Tests and Debugging Your Code 9. QWeb and Kanban Views 10. Creating QWeb Reports 11. Creating Website Frontend Features 12. External API – Integrating with Other Systems 13. Deployment Checklist – Going Live

Installing Odoo from the 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 them 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 a /odoo-dev directory inside our home directory.

Note

Throughout the book, we will assume that /odoo-dev is the directory where your Odoo server is installed.

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

$ whoami
odoo
$ echo $HOME
/home/odoo

Now we can use this script. It shows us how to install Odoo from the source into a Debian/Ubuntu system.

First, install the basic dependencies to get us started:

$ sudo apt-get update && sudo apt-get upgrade  #Install system updates
$ sudo apt-get install git  # Install Git
$ sudo apt-get install npm  # Install NodeJs and its package manager
$ sudo ln -s /usr/bin/nodejs /usr/bin/node  # call node runs nodejs
$ sudo npm install -g less less-plugin-clean-css  #Install less compiler

Starting from version 9.0, the Odoo web client requires the less CSS preprocessor to be installed in the system, in order for web pages to be rendered correctly. To install this, we need Node.js and npm.

Next, we need to get the Odoo source code and install all its dependencies. The Odoo source code includes an utility script, inside the odoo/setup/ directory, to help us install the required dependencies in a Debian/Ubuntu system:

$ 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 10.0 --depth=1  # Get Odoo source code

$ ./odoo/setup/setup_dev.py setup_deps  # Installs Odoo system dependencies
$ ./odoo/setup/setup_dev.py setup_pg  # Installs PostgreSQL & db superuser for unix user

At the end, Odoo should be ready to use. The ~ symbol is a shortcut for our home directory (for example, /home/odoo). The git -b 10.0 option tells Git to explicitly download the 10.0 branch of Odoo. At the time of writing, this is redundant since 10.0 is the default branch; however, this may change, so it may make the script future-proof. The --depth=1 option tells Git to download only the last revision, instead of the full change history, making the download smaller and faster.

To start an Odoo server instance, just run:

$ ~/odoo-dev/odoo/odoo-bin

Tip

In Odoo 10, the odoo.py script, used in previous versions to start the server, was replaced with odoo-bin.

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

Installing Odoo from the source

As a developer, we will need to work with several databases, so it's more convenient to create them from the command line, so we will learn how to do this. Now press Ctrl + C  in the terminal to stop the Odoo server and get back to the command prompt.

You have been reading a chapter from
Odoo 10 Development Essentials
Published in: Nov 2016
Publisher: Packt
ISBN-13: 9781785884887
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image