Ir al contenido principal

Installing OpenERP 7 in Ubuntu Server 12.04 from launchpad

OpenERP
 Begin installing the necessary software to install OpenERP:

sudo apt-get install graphviz ghostscript postgresql-client \
python-dateutil python-feedparser python-matplotlib \
python-ldap python-libxslt1 python-lxml python-mako \
python-openid python-psycopg2 python-pybabel python-pychart \
python-pydot python-pyparsing python-reportlab python-simplejson \
python-tz python-vatnumber python-vobject python-webdav \
python-werkzeug python-xlwt python-yaml python-imaging postgresql bzr
 
sudo apt-get install python-dev mc python-setuptools python-babel \
python-feedparser python-reportlab-accel python-zsi python-openssl \
python-egenix-mxdatetime python-jinja2 python-unittest2 python-mock \
python-docutils lptools python-psutil python-paramiko poppler-utils \
python-pdftools antiword  

wget http://gdata-python-client.googlecode.com/files/gdata-2.0.17.tar.gz 
tar zxvf gdata-2.0.17.tar.gz 
cd gdata-2.0.17/
sudo python setup.py install
 
Create the OpenERP user:
sudo adduser openerp  --home=/opt/openerp 

Create the database and user openerp postgresql:

sudo passwd postgres
su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt openerp
exit

Install the OpenERP server:
su - openerp 
mkdir v7
cd v7
bzr branch lp:openerp-web/7.0 web
bzr branch lp:openobject-server/7.0 server
bzr branch lp:openobject-addons/7.0 addons
bzr branch lp:openerp-spain/7.0    
exit
 

Configuring the OpenERP server:
sudo cp /opt/openerp/v7/server/install/openerp-server.conf /etc/openerp-server.conf
sudo chown openerp.openerp /etc/openerp-server.conf
sudo chmod 640 /etc/openerp-server.conf 
sudo nano /etc/openerp-server.conf
 
In the configuration file /etc/openerp-server.conf leave it at that:
[options]
; This is the password that allows database operations:
admin_passwd = <administrator-password>
db_host = False
db_port = False
db_user = openerp
db_list = False
db_password = <postgresql-password>
addons_path = /opt/openerp/v7/addons,/opt/openerp/v7/web/addons,/opt/openerp/v7/7.0
;Log settings
logfile = /var/log/openerp/openerp-server.log
log_level = error 
 

Configuring the system for proper functioning of the log:


sudo mkdir /var/log/openerp
sudo chown openerp.root /var/log/openerp
sudo cp /opt/openerp/v7/server/install/openerp-server.logrotate /etc/logrotate.d/openerp-server
sudo chmod 755 /etc/logrotate.d/openerp-server

Auto Start OpenERP server, then:
sudo touch  /etc/init.d/openerp-server
sudo chmod 755 /etc/init.d/openerp-server
sudo chown root: /etc/init.d/openerp-server
sudo update-rc.d openerp-server defaults
sudo nano /etc/init.d/openerp-server

Contents of file-server /etc/init.d/openerp:
#!/bin/sh

### BEGIN INIT INFO
# Provides:             openerp-server
# Required-Start:       $remote_fs $syslog
# Required-Stop:        $remote_fs $syslog
# Should-Start:         $network
# Should-Stop:          $network
# Default-Start:        2 3 4 5
# Default-Stop:         0 1 6
# Short-Description:    Enterprise Resource Management software
# Description:          Open ERP is a complete ERP and CRM software.
### END INIT INFO

PATH=/bin:/sbin:/usr/bin
DAEMON=/opt/openerp/v7/server/openerp-server
NAME=openerp-server
DESC=openerp-server

# Specify the user name (Default: openerp).
USER=openerp

# Specify an alternate config file (Default: /etc/openerp-server.conf).
CONFIGFILE="/etc/openerp-server.conf"

# pidfile
PIDFILE=/var/run/$NAME.pid

# Additional options that are passed to the Daemon.
DAEMON_OPTS="-c $CONFIGFILE"

[ -x $DAEMON ] || exit 0
[ -f $CONFIGFILE ] || exit 0

checkpid() {
    [ -f $PIDFILE ] || return 1
    pid=`cat $PIDFILE`
    [ -d /proc/$pid ] && return 0
    return 1
}

case "${1}" in
        start)
                echo -n "Starting ${DESC}: "

                start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
                        --chuid ${USER} --background --make-pidfile \
                        --exec ${DAEMON} -- ${DAEMON_OPTS}

                echo "${NAME}."
                ;;

        stop)
                echo -n "Stopping ${DESC}: "

                start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
                        --oknodo

                echo "${NAME}."
                ;;

        restart|force-reload)
                echo -n "Restarting ${DESC}: "

                start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
                        --oknodo
      
                sleep 1

                start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
                        --chuid ${USER} --background --make-pidfile \
                        --exec ${DAEMON} -- ${DAEMON_OPTS}

                echo "${NAME}."
                ;;

        *)
                N=/etc/init.d/${NAME}
                echo "Usage: ${NAME} {start|stop|restart|force-reload}" >&2
                exit 1
                ;;
esac

exit 0
 
To start the server:
sudo /etc/init.d/openerp-server start 

 

OpenERP on port 80 and 443

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8069
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8070
iptables-save 

Apply updates

sudo /etc/init.d/openerp-server stop
sudo su openerp
cd /opt/openerp/v7/addons/
bzr pull
cd /opt/openerp/v7/web/
bzr pull
cd /opt/openerp/v7/7.0/
bzr pull
cd /opt/openerp/v7/server/
bzr pull

./openerp-server -c /etc/openerp-server.conf -u all -d <base-de-datos>

Patching

cd /opt/openerp/v7/addons/
bzr patch <url-al-parche>

 
Sources of information:
http://help.openerp.com/question/2562/how-to-install-openerp-v70-on-ubuntu-1204-from-launchpad-repository/ 
http://www.theopensourcerer.com/2012/12/how-to-install-openerp-7-0-on-ubuntu-12-04-lts/ 
http://huber.salazarcarlos.com/?p=23


Comentarios

Entradas populares de este blog

Conectar Dolibarr con otra aplicación mediante un servicio SOAP

Para conectar con Dolibarr otras aplicaciones, como un carrito de la compra, puede ser muy interesante utilizar los " Web Services " que nos ofrece Dolibarr. Para activarlos tenemos que ir a Configuración-> Módulos-> Módulos Interfaz y poner a ON los WebServices. También hay que configurar la clave para usar los Web Services (parámetro "dolibarrkey" en webservices). Indicamos una palabra clave que se nos ocurra como por ejemplo: $5x8Cd45Cadec_f?K y pulsamos salvar. A continuación muestro un ejemplo con Python y la librería suds para obtener una factura: from suds.client import Client client = Client('http://www.midominio.es/dolibarr/webservices/server_invoice.php?wsdl') auth = client.factory.create('authentication') auth.dolibarrkey='$5x8Cd45Cadec_f?K' auth.sourceapplication='' auth.login='usuario' auth.password='clave' auth.entity='' result = client.service.getInvoice(auth,'1') print resu...

Instalación Django en NAS Synology con FastCGI

Los NAS Synology no traen el módulo de apache mod-wsgi por lo que he utilizado el módulo mod-fastcgi en su lugar para hacer funcionar Django en los NAS Synology. Necesitamos del módulo mysql-python , para su instalación podemos seguir la entrada que ya se publicó en este mismo blog:  http://ilizaran.blogspot.com.es/2014/09/instalacion-del-modulo-mysql-python-en.html De la instalación de mysql-python ya tendremos instalado pip en el NAS por lo que podremos instalar Django con algunos módulos necesarios: pip install Django pip install setuptools pip install flup Para saber que la instalación de Django ha sido correcta y verificar la versión podemos realizar: python import django  django.VERSION Ahora modifcamos la configuración de apache editando el fichero /etc/httpd/conf/httpd.conf-user  para hacer accesible los ficheros css, imágenes y javascript de la parte administrativa de Django, por lo que añadimos: Alias /static/admin /usr/local/packages/@appstor...

Calendario compartido en thunderbird sincronizado con el calendario de Google.

Se pretende crear un calendario común y compartido para que todos los que queramos vean nuestro calendario. Para ello tenemos que tener el thunderbird que es un cliente de correo. Si ya teníamos thunderbird, solamente tenemos que instalar 2 complementos: lightning y provider for google calendar . Para instalarlos simplemente entramos en thunderbird y en el menú superior entramos en Herramientas > Complementos . En la parte superior hay una barra para buscar los complementos y simplemente escribimos los 2 complementos dichos anteriormente y reiniciamos thunderbird. Ahora creamos una cuenta en google y si la tenemos no hace falta crearla. Accedemos a la cuenta de google y entramos en Calendar Una vez hemos entrado, a la izquierar nos saldrán los calendarios que tenemos. Creamos un nuevo calendario desplegando la pestaña que está al lado de Mis calendarios.   Creamos un calendario al que le vamos a llamar prueba. Ya estaría creado nuestro calendario. Entramos ...