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
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Odoo Development Essentials

You're reading from   Odoo Development Essentials Fast track your development skills to build powerful Odoo business applications

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher Packt
ISBN-13 9781784392796
Length 214 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Getting Started with Odoo Development FREE CHAPTER 2. Building Your First Odoo Application 3. Inheritance – Extending Existing Applications 4. Data Serialization and Module Data 5. Models – Structuring the Application Data 6. Views – Designing the User Interface 7. ORM Application Logic – Supporting Business Processes 8. QWeb – Creating Kanban Views and Reports 9. External API – Integration with Other Systems 10. Deployment Checklist – Going Live Index

More server configuration options

The Odoo server supports quite a few other options. We can check all available options with the --help option:

$ ./odoo.py --help

It's worth while to have an overview on the most important ones.

Odoo server configuration files

Most of the options can be saved in a configuration file. By default, Odoo will use the .openerp-serverrc file in your home directory. Conveniently, there is also the --save option to store the current instance configuration into that file:

$ ~/odoo-dev/odoo/odoo.py --save --stop-after-init  # save configuration to file

Here we also used the --stop-after-init option, to have the server stop after it finishes its actions. This option is often used when running tests or asking to run a module upgrade to check if it installs correctly.

Now we can inspect what was saved in this default configuration file:

$ more ~/.openerp_serverrc  # show the configuration file

This will show all configuration options available with the default values for them. Editing them will be effective the next time you start an Odoo instance. Type q to quit and go back to the prompt.

We can also choose to use a specific configuration file, using the --conf=<filepath> option. Configuration files don't need to have all those the options you've just seen. Only the ones that actually change a default value need to be there.

Changing the listening port

The --xmlrpc-server=<port> command allows us to change the default 8069 port where the server instance listens. This can be used to run more than one instances at the same time, on the same server.

Let's try that. Open two terminal windows. On the first one run:

$ ~/odoo-dev/odoo.py --xmlrpc-port=8070

and on the other run:

$ ~/odoo-dev/odoo.py --xmlrpc-port=8071

And there you go: two Odoo instances on the same server listening on different ports. The two instances can use the same or different databases. And the two could be running the same or different versions of Odoo.

Logging

The --log-level option allows us to set the log verbosity. This can be very useful to understand what is going on in the server. For example, to enable the debug log level use: --log-level=debug

The following log levels can be particularly interesting:

  • debug_sql to inspect SQL generated by the server
  • debug_rpc to detail the requests received by the server
  • debug_rpc_answer to detail the responses sent by the server

By default the log output is directed to standard output (your console screen), but it can be directed to a log file with the option --logfile=<filepath>.

Finally, the --debug option will bring up the Python debugger (pdb) when an exception is raised. It's useful to do a post-mortem analysis of a server error. Note that it doesn't have any effect on the logger verbosity. More details on the Python debugger commands can be found here: https://docs.python.org/2/library/pdb.html#debugger-commands.

You have been reading a chapter from
Odoo Development Essentials
Published in: Apr 2015
Publisher: Packt
ISBN-13: 9781784392796
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