waeup.odoo
**********

Install
=======

Please note, that **only Linux-based installs** are described and actively
supported. We recommend use of Debian / Ubuntu.


Preparing the System
--------------------

Necessary packages can be installed on Debian systems like this::

  $ sudo apt-get install postgresql

Occasionally, PostgreSQL 9.1 database server cannot be started.
In order to resolve the error, you need to edit the postgresql.conf file
(located in my /etc/postgresql/9.1/main directory).
By default, the ssl is set to true and that is the reason which causes
the “meaningful” error. You need to set it to false.
[Source: http://www.jusuchyne.com/codingchyne/2010/04/postgres-could-not-load-private-key-file/]

Restart postgresql and continue with package installation::

  $ sudo apt-get install postgresql-server-dev-9.1 \
                         python2.7 python2.7-dev build-essential \
                         libldap2-dev libsasl2-dev libjpeg-dev \
                         libxslt1-dev libxml2-dev
                         python-virtualenv \
                         git \
                         python-simplejson \
                         python-dateutil \
                         python-psycopg2 \
                         python-werkzeug \
                         python-decorator \
                         python-yaml \
                         python-unittest2 \
                         python-reportlab \
                         python-mako \
                         python-pychart \
                         python-psutil \
                         python-requests \
                         python-jinja2 \
                         python-openid \
                         python-pyPDF \



Configuring Odoo User on Postgres
---------------------------------

Create a new database user. This is so Odoo has access rights to connect
to PostgreSQL and to create and drop databases. Remember what your choice
of password is here; you will need it later on::

  $ sudo su - postgres
  $ createuser --createdb --username postgres --no-createrole --pwprompt odoo
  $ exit


Preparing Odoo System User and Home Folder
------------------------------------------

  $ sudo adduser --system --group --shell /bin/bash --home /odoo odoo

Login as Odoo user::

  $ sudo bash
  $ su odoo
  $ cd ~


Predefining the ``eggs`` folder
-------------------------------

Create ``~/.buildout/default.cfg`` with the
following contents::

  [buildout]
  eggs-directory = /odoo/eggs


Bootstrapping the Buildout
--------------------------

Install local sandbox::

  $ virtualenv --no-site-packages py27

Activate local sandbox::

  $ source py27/bin/activate

Checkout ``waeup.odoo``::

  (py27)$ svn co https://svn.waeup.org/repos/main/waeup.odoo/trunk myodoo

Finally, perform the bootstrap with the virtualenv's Python::

  (py27)$ cd myodoo
  (py27)$ python bootstrap.py


Running the Build
-----------------

Just run::

  $ bin/buildout

Starting Odoo
-------------

Run

  $ parts/odoo/openerp-server

to start in foreground or

  nohup parts/odoo/openerp-server &

to start in background. The scripts in bin/ are broken.