Usando Linux para muchas cosas y disfrutando de videojuegos, en dispositivos moviles, consolas y pc. Using Linux for many things and enjoying video games, mobile devices, consoles and pc

Mostrando entradas con la etiqueta openerp. Mostrar todas las entradas
Mostrando entradas con la etiqueta openerp. Mostrar todas las entradas

Como instalar odoo ERP en Linux Centos 7 paso a paso

DriveMeca instalando Odoo en Linux Centos paso a paso
Que tan organizado es tu negocio? Mucho, me dirás, pero, lo tienes sistematizado, como manejas tus clientes, la facturación que tal se maneja?. Muchos temas que si no se unifican se vuelve un monstruo creciente difícil de manejar. Para esto una buena practica es manejar un ERP junto a otras herramientas idealmente conectadas entre si. Lo que nos lleva al tema del articulo de hoy, instalar paso a paso Odoo (antiguo OpenERP) en un servidor Linux Centos 7 con PostgreSQL.

Requerimientos instalación de Odoo ERP en Linux Centos

-Instalamos el repositorio de epel en su ultima versión. Esto nos permitirá resolver dependencias necesitadas por Odoo
yum install -y epel-release

Instalamos PostgreSQL apara Odoo en Linux Centos

-Instalamos el repositorio de PostgreSQL 9.6 o la ultima versión disponible al momento
yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm

-Instalamos el grupo de PostgreSQL junto a algunas dependencias necesarias
yum groupinstall "PostgreSQL Database Server 9.6 PGDG"
yum install php-pgsql php-gd yum-utils sudo
yum install ftp://mirror.switch.ch/pool/4/mirror/centos/7.3.1611/cr/x86_64/Packages/http-parser-2.7.1-1.el7.x86_64.rpm

-Inicializamos y activamos PostgreSQL para que ejecute al hacer boot nuestro servidor
/usr/pgsql-9.6/bin/postgresql96-setup initdb
systemctl enable postgresql-9.6

-Permitimos conexiones con md5 en PostgreSQL
sed -i "/^host/s/ident/md5/g" /var/lib/pgsql/9.6/data/pg_hba.conf

-Iniciamos el servicio de PostgreSQL
systemctl start postgresql-9.6

Instalamos Odoo en Linux Centos

-Agregamos el repositorio (actualizado todas las noches) de Odoo
yum-config-manager --add-repo=https://nightly.odoo.com/10.0/nightly/rpm/odoo.repo

-Instalamos Odoo
yum install odoo

-Una ultima dependencia, necesaria para poder manejar archivos pdf
yum install https://downloads.wkhtmltopdf.org/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-centos7-amd64.rpm

-Activamos Odoo para su inicio cada vez que haga boot el servidor Linux Centos y lo iniciamos
systemctl enable odoo
systemctl start odoo

-Abrimos el puerto tcp 8069 en las reglas de firewall de Linux Centos
firewall-cmd --zone=public --add-port=8069/tcp --permanent
firewall-cmd --reload

Configuramos Odoo en Linux Centos

-Abrimos un browser en otro equipo y navegamos al URL http://ip-servidor:8069/ Reemplazando ip-servidor con la ip de tu servidor Linux Centos

-Llegaremos a una pagina para crear la db en PostgreSQL a usar en Odoo. Llenamos los campos:

Database Name: Nombre de la db que crearemos
Email: Un email valido
Password: Tu contraseña de ingreso como administrador, si quieres verla dale click al ojo de la derecha en la caja de texto
Language: Elige tu idioma de la lista
Country: Pais
Si quieres que se carguen datos de ejemplo en la db, marca el checkmark Load demonstration data

Damos click al botón Create database

En caso de error, baja mas en este articulo y veras un listado de posibles errores y como solucionarlos
Creando la db de Odoo via web

-Nos recibe seguidamente una pagina con el listado de modulos disponibles a instalar, pero antes un paso mas
Listado de modulos de Odoo en interfaz web

-Dale click a Administrator - Preferencias en la esquina superior derecha
Ingreso al perfil de administrador en Odoo

-Verifica tu Idioma y zona horaria. De paso puedes crearte una firma para los emails. Damos click al botón Guardar
Modificamos el perfil de administrador en Odoo

Posibles errores Odoo y como corregirlos

Normalmente no deben haberlos, pero puede que se te presente alguno y los ire escribiendo en esta sección en la medida que se me presenten

Database creation error: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) HINT: Use the same encoding as in the template database, or use template0 as template.
Error de Odoo UTF8 y como corregirlo


-Abrimos una consola en el servidor y ejecutamos
sudo -u postgres psql postgres
psql (9.6.2)
Type "help" for help.

postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0" as user "postgres".
template0=#  update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1
template0=# drop database template1;
DROP DATABASE
template0=# create database template1 with template = template0 encoding = 'UTF8';
CREATE DATABASE
template0=# update pg_database set datistemplate = TRUE where datname = 'template1';
UPDATE 1
template0=# \c template1
You are now connected to database "template1" as user "postgres".
template1=# update pg_database set datallowconn = FALSE where datname = 'template0';
UPDATE 1

Presionamos la combinación de teclas Ctrl D para salir de pgsql


Artículos recomendadosLlevando el control de tu negocio con Dolibarr ERP/CRM
                                           Como instalar QuickBooks Database Server 13 en Linux
                                           Como instalar Vtiger CRM paso a paso en Linux
                                           Conoce mejor a tus clientes; instala SugarCRM
                                           Playlist Linux apps en YouTube

Ya estamos listos para personalizar Odoo a nuestras necesidades
Usaste OpenERP? Ya usas Odoo? Que tal te ha parecido?

Quieres apoyarme? El conocimiento es gratis pero...igual tengo gastos. Puedes donarme dinero por medio de PayPal para equipar mi laboratorio, equipos para pruebas, infraestructura de redes, etc que utilizo haciendo estos artículos y vídeos.


Aun tienes dudas y quieres preguntarme algo que por email no crees posible? ahora puedes agendar una cita virtual conmigo (por medio de hangout de google), haz click aquí para agendar cita conmigo. Bien, hazme un favor, compártelo en tus redes sociales (compartir es sexy). Escríbeme en los comentarios aquí debajo y pasa la voz compartiendo el tweet.
Sígueme en twitter google+facebook o email y podrás estar enterado de todas mis publicaciones.
Disfrútenlo.

Share/Bookmark

Como instalar y configurar OpenERP virtual paso a paso

Hoy les mostrare como instalar OpenERP en un Ubuntu server 10.04 virtualizado con openvz en nuestro server Proxmox. Todo lo haremos desde la cuenta root y usaremos la modalidad de acceso via web a este software.

Requerimientos:
Ubuntu 10.04
ip: 192.168.1.35
OpenERP Server 6.0.3
Open ERP web 6.0.3

-Creamos un usuario sin privilegios
adduser --system --home=/opt/openerp --group openerp

-Instalamos pgsql
apt-get install postgresql

-Cambiamos al user de pgsql para configurar el usuario de openerp
su - postgres

createuser --createdb --username postgres --no-createrole --pwprompt openerp
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) y

exit

-Instalamos librerías de python

apt-get install python python-psycopg2 python-reportlab python-egenix-mxdatetime python-tz python-pychart python-mako python-pydot python-lxml python-vobject python-yaml python-dateutil python-pychart python-pydot python-webdav

-Librerías para cliente web
apt-get install python-cherrypy3 python-formencode python-pybabel python-simplejson python-pyparsing

-Descargamos openerp server
wget -c http://www.openerp.com/download/stable/source/openerp-server-6.0.3.tar.gz

-Descargamos el cliente web
wget -c http://www.openerp.com/download/stable/source/openerp-web-6.0.3.tar.gz

-Descomprimimos
tar xvf /root/openerp-server-6.0.3.tar.gz
tar xvf /root/openerp-web-6.0.3.tar.gz

-Cambiamos atributos
chown -R openerp: *

ls -la
total 16
drwxr-xr-x  4 openerp openerp 4096 Mar  5 17:22 .
drwxr-xr-x  3 root    root    4096 Mar  5 17:05 ..
drwxr-xr-x 10 openerp openerp 4096 Aug 18  2011 openerp-server-6.0.3
drwxr-xr-x  9 openerp openerp 4096 Aug 18  2011 openerp-web-6.0.3

cp -a openerp-server-6.0.3 server
cp -a openerp-web-6.0.3 web

-Creamos el file de configuracion, colocamos en db_password la contraseña que hayamos puesto anteriormente
vi /etc/openerp-server.conf
[options]
; This is the password that allows database operations
; Will be written to by the server when password is changed
; !! Keep this file secure !!
; admin_passwd = admin
root_path = /opt/openerp/server/bin
without_demo = False
verbose = False
; Database settings
db_user = openerp
db_password = contraseña
; Please uncomment the following line *after* you have created the
; database. It activates the auto module check on startup.
; db_name = False
db_port = False
db_host = False
db_maxconn = 64
; Networking Settings
xmlrpc = True
xmlrpc_interface = 127.0.0.1
xmlrpc_port = 8069
netrpc = True
netrpc_interface = 127.0.0.1
netrpc_port = 8070
; Uncomment these for xml-rpc over SSL
xmlrpcs = True
xmlrpcs_interface =
xmlrpcs_port = 8071
secure_pkey_file = /etc/ssl/openerp/server.pkey
secure_cert_file = /etc/ssl/openerp/server.crt
; Log settings
logfile = /var/log/openerp/openerp-server.log
syslog = False
logrotate = True
log_level = info
; False prevents the client displaying the list of databases
list_db = True
addons_path = /opt/openerp/server/bin/addons
demo = {}
soap = False
reportgz = False
translate_modules = ['all']
; Static http parameters
static_http_enable = False
static_http_document_root = /var/www/html
static_http_url_prefix = /
; Outbound email configuration
;smtp_user = info@example.com
;email_from = "OpenERP Support" <info@example.com>
;smtp_port = 25
;smtp_password = ********
;smtp_ssl = True
[webdav]
enable = True
vdir = webdav

-Cambiamos permisos
chown openerp:root /etc/openerp-server.conf
chmod 640 /etc/openerp-server.conf

-Creamos el script de inicio
vi /etc/init.d/openerp-server
#!/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/server/bin/openerp-server.py
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

-Cambiamos permisos
chmod 755 /etc/init.d/openerp-server
chown root: /etc/init.d/openerp-server

-Creamos directorio de logs
mkdir /var/log/openerp
chown openerp:root /var/log/openerp

-Iniciamos el server
/etc/init.d/openerp-server start

-Verificamos este ok
cat /var/log/openerp/openerp-server.log
[2012-03-05 17:50:01,937][?] INFO:server:OpenERP version - 6.0.3
[2012-03-05 17:50:01,937][?] INFO:server:addons_path - /opt/openerp/server/bin/addons
[2012-03-05 17:50:01,937][?] INFO:server:database hostname - localhost
[2012-03-05 17:50:01,938][?] INFO:server:database port - 5432
[2012-03-05 17:50:01,938][?] INFO:server:database user - openerp
[2012-03-05 17:50:01,938][?] INFO:server:initialising distributed objects services
[2012-03-05 17:50:02,504][?] INFO:web-services:starting HTTP service at 0.0.0.0 port 8069
[2012-03-05 17:50:02,504][?] INFO:web-services:starting HTTPS service at 0.0.0.0 port 8071
[2012-03-05 17:50:02,505][?] INFO:web-services:Registered XML-RPC over HTTP
[2012-03-05 17:50:02,509][?] INFO:web-services:starting NET-RPC service at 0.0.0.0 port 8070
[2012-03-05 17:50:02,509][?] INFO:server:Starting 3 services
[2012-03-05 17:50:02,510][?] INFO:server:OpenERP server is running, waiting for connections...

-Activamos que ejecute al inicio
update-rc.d openerp-server defaults

-Configuramos el cliente web
cp /opt/openerp/web/doc/openerp-web.cfg /etc/openerp-web.conf

-Editamos
vi /etc/openerp-web.conf
server.socket_host = "127.0.0.1"
tools.proxy.on = True
tools.proxy.base = 'http://192.168.1.35'
tools.csrf.on = False
log.error_file = "/var/log/openerp/openerp-web-error.log"
Salimos guardando

-Cambiamos permisos
chown openerp:root /etc/openerp-web.conf
chmod 640 /etc/openerp-web.conf

-Creamos el script de inicio
vi /etc/init.d/openerp-web
#!/bin/sh

### BEGIN INIT INFO
# Provides:             openerp-web
# 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:    OpenERP Web - the Web Client of the OpenERP
# Description:          Open ERP is a complete ERP and CRM software.
### END INIT INFO

PATH="/sbin:/bin:/usr/sbin:/usr/bin"
DAEMON="/opt/openerp/web/openerp-web.py"
NAME="openerp-web"
DESC="openerp-web"

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

# Specify an alternate config file (Default: /etc/openerp-web.conf).
CONFIGFILE="/etc/openerp-web.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

Salimos guardando

-Cambiamos permisos
chmod 755 /etc/init.d/openerp-web
chown root: /etc/init.d/openerp-web

-Ejecutamos el servicio
/etc/init.d/openerp-web start

-Verificamos conectandonos via firefox
http://192.168.1.35:8080/


-Activamos que ejecute al inicio
update-rc.d openerp-web defaults

-Activamos SSL para apache
a2enmod ssl proxy_http headers rewrite
cd
mkdir temp
cd temp

-Generamos un nuevo certificado
openssl genrsa -des3 -out server.pkey 1024
Generating RSA private key, 1024 bit long modulus
.............++++++
...............................++++++
e is 65537 (0x10001)
Enter pass phrase for server.pkey:
Verifying - Enter pass phrase for server.pkey:

-Evitando tener que colocar la contraseña cada vez que iniciemos apache
openssl rsa -in server.pkey -out server.key
Enter pass phrase for server.pkey:
writing RSA key

-Seguimos
openssl req -new -key server.key -out server.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:CO
State or Province Name (full name) [Some-State]:Cundinamarca
Locality Name (eg, city) []:Bogota
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Compañia S.A
Organizational Unit Name (eg, section) []:Sistemas
Common Name (eg, YOUR name) []:Manuel Cabrera Caballero
Email Address []:mi-email@gmail.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:contraseña
An optional company name []:

-Terminamos de firmar
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

-Cambiamos permisos y copiamos
chown openerp:root server.crt server.key
chmod 640 server.crt server.key

mkdir /etc/ssl/openerp
chown openerp:root /etc/ssl/openerp
chmod 710 /etc/ssl/openerp
mv server.crt server.key /etc/ssl/openerp/

-Activamos el certificado en apache
vi /etc/apache2/sites-available/openerp-ssl
<VirtualHost *:443>
   SSLEngine on
   SSLCertificateFile /etc/ssl/openerp/server.crt
   SSLCertificateKeyFile /etc/ssl/openerp/server.key
   ProxyRequests Off
 <Proxy *>
   Order deny,allow
   Allow from all
 </Proxy>
   ProxyVia On
   ProxyPass /webdav/ http://127.0.0.1:8069/webdav/
 <Location /webdav/ >
   ProxyPassReverse /webdav/
 <Limit OPTIONS PROPFIND GET REPORT MKACTIVITY PROPPATCH PUT MOVE COPY DELETE LOCK UNLOCK>
   Order Deny,Allow
   Allow from all
   Satisfy Any
 </Limit>
 </Location>
   ProxyPass / http://127.0.0.1:8080/
 <location / >
   ProxyPassReverse /
 </location>
   RequestHeader set "X-Forwarded-Proto" "https"
   # Fix IE problem (httpapache proxy dav error 408/409)
   SetEnv proxy-nokeepalive 1
</VirtualHost>

Salimos guardando

a2ensite openerp-ssl

-Redireccionamos trafico web normal a SSL(colocar las lineas fuera de las clausulas <Directory> al final
vi /etc/apache2/sites-available/default
RewriteEngine on
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]

Salimos guardando

-Reiniamos servicios
service openerp-server restart
service openerp-web restart
service apache2 restart

-Creamos la db desde el cliente web, nos conectamos via https desde firefox
https://192.168.1.35

-Damos click en el boton Databases y creamos una nueva db con una nueva contraseña para el usuario admin de esta db. La contraseña original es admin, la cual por seguridad debemos cambiar. Damos click en el boton Create

-Llegamos a una pagina donde nos dice que tenemos un usuario admin y un usuario demo, damos click en Empezar configuracion

-Proxima pagina, seleccionar Interfaz, dejamos la simplificada y damos click en Siguiente

-Proxima pagina, Informacion de la compañia, cambiamos los datos a nuestra necesidad, subimos el logo de la compañia y damos click en Siguiente

-Proxima pagina, Aplicaciones, podemos escoger o dejarlas desmarcadas para mas adelante instalarlas cuando las necesitemos, damos click en Saltar

Y con esto ya tenemos un server OpenERP listo para configurar segun nuestro negocio.


Si te resulto útil este articulo, se social, haz un tweet, compártelo con otros por medio de los botones o sígueme en twitter google+facebook o email y podrás estar enterado de todas mis publicaciones.
Disfrútenlo.

Share/Bookmark