Instalación de Odoo 17 CE

Marlon Falcón Hernández | Madrid, España

--config=/Users/marlonfalcon/Documents/odoo/odoo-16/odoo/debian/odooee.conf -u base_bim_2 --i18n-overwrite

0- Creamos una cuenta en Digital Ocean

https://m.do.co/c/7f5c3af8d6bb

0A- Copiamos la clave de acceso del server para que no las pidas mas

ssh-copy-id root@159.89.29.221

1- Actualizamos el sistema

apt-get update && apt-get upgrade -y

2- Instalamos odoo 17.0

wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
echo "deb http://nightly.odoo.com/17.0/nightly/deb/ ./" >> /etc/apt/sources.list
apt-get update && apt-get install odoo
apt-get install node-less

3 - Instalamos ngix para cambiar el puerto

sudo apt-get install nginx -y
cd /etc/nginx/sites-available
git clone https://github.com/falconsoft3d/ngix-para-odoo-erp/
cd ngix-para-odoo-erp/
sudo cp /etc/nginx/sites-available/ngix-para-odoo-erp/default.conf /etc/nginx/sites-available/default.conf
cd ..
mv default default-temp
mv default.conf default

cd /etc/nginx/sites-available
nano default
server_name j.wemakeyourdayeasy.com 11.64.123.12;
nginx -s reload
nano /etc/nginx/sites-available/default
tail -f /var/log/nginx/access.log
tail -f /var/log/nginx/error.log;

4 - Creamos Carpeta Extra-addons

mkdir /opt/extra-addons
chown odoo: /opt/extra-addons/ -R

5 - Creamos Carpeta Respaldos

mkdir /opt/backup
chown odoo: /opt/backup/ -R

6- Instalar wkhtmltopdf para generar PDF en odoo

# sudo apt-get remove wkhtmltopdf
sudo apt-get install -y xfonts-75dpi

wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb

wkhtmltopdf --version

7- Configuramos el conf de odoo

nano /etc/odoo/odoo.conf
limit_time_real = 360

8- Tools

service odoo restart
tail -f /var/log/odoo/odoo-server.log

9- Generamos la clave publica

ssh-keygen
cat ~/.ssh/id_rsa.pub

9a- Librerias complementarias

sudo apt-get install build-essential python3-pil python3-lxml python3-dev python3-pip python3-setuptools npm nodejs git gdebi libldap2-dev libxml2-dev libxslt1-dev libjpeg-dev -y
sudo npm install -g less less-plugin-clean-css -y && sudo ln -s /usr/bin/nodejs /usr/bin/node
python3 -m pip install --upgrade pip setuptools wheel
sudo pip3 install paramiko
sudo pip3 install xmltodict
sudo pip3 install xmlsig
sudo pip3 install num2words
sudo pip3 install pandas
sudo pip3 install phonenumbers
python3 -m pip install --upgrade pip setuptools wheel

10- Instalamos las librerias de Python

pip3 install xmltodict
pip3 install dicttoxml
pip3 install cchardet
pip3 install cryptography
sudo pip3 install pyOpenSSL
6) M2Crypto
  - sudo apt-get install python-m2crypto
  - sudo apt-get install libssl-dev swig python3-dev gcc
  - sudo pip3 install M2Crypto
sudo pip3 install SOAPpy
sudo pip3 install signxml
sudo pip3 install pdf417gen

10b- Instalando m2crypto en MAC.

$> brew install openssl
$> brew install swig
$> env LDFLAGS="-L$(brew --prefix openssl)/lib" \
CFLAGS="-I$(brew --prefix openssl)/include" \
SWIG_FEATURES="-cpperraswarn -includeall -I$(brew --prefix openssl)/include" \
pip install m2crypto
pip3 install pycrypto
sudo apt-get install python-m2crypto

10- Instalando el certificado digital ( https://certbot.eff.org/lets-encrypt/ubuntuxenial-nginx )

sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python3-certbot-nginx
sudo certbot --nginx
-A
- 2
Dentro de Odoo configuras los parámetros.
Configuración > Parámetros > Parámetros del sistema

web.base.url
http -> https

web.base.url.freeze
True

11- buscamos los repos oficiales de odoo

mkdir /opt/extra-addons-odoo
chown odoo: /opt/extra-addons-odoo/ -R
cd /opt/extra-addons-odoo/
git clone https://github.com/odoo/odoo.git
git checkout 14.0

12- Actualizar Odoo all

/etc/init.d/odoo stop
su - odoo -s /bin/bash
odoo -d db11-spain -u all --stop-after-init --logfile=/dev/stdout
/etc/init.d/odoo start

13- Buscar Odoo en Linux

find / -name "odoo"

14- Shell Odoo

/etc/init.d/odoo stop
su - odoo -s /bin/bash
odoo shell -d db11-spain

mod=env['ir.module.module'].search([('name','=','purchase_request')])
print(mod)

products=env['product.template'].search([('type', '=', 'consu')])
for product in products:
    try:
        print(product.id)
        print('Modificando')
        product.type = 'product'
    except:
        print('error')

env.cr.commit()

/etc/init.d/odoo start

conf

addons_path = /usr/lib/python3/dist-packages/odoo/addons,/opt/extra-addons/addons_general,/opt/extra-addons/addons_3ros,/opt/extra-addons/credit
admin_passwd = $pbkdf2-sha512$25000$1poTYiylFOKcs3YuxVgLYQ$EJYtGA5.NwOm0V.VRXhSnCD7SvB30Q1prQ7MA.uzbfKVPRbwihg0eukjNP4wikRdnHYiXrcoOM75fhT6fuspzQ
csv_internal_sep = ,
data_dir = /var/lib/odoo/.local/share/Odoo
db_host = False
db_maxconn = 64
db_name = False
db_password = False
db_port = False
db_sslmode = prefer
db_template = template0
db_user = odoo
dbfilter =
demo = {}
email_from = False
geoip_database = /usr/share/GeoIP/GeoLite2-City.mmdb
http_enable = True
http_interface =
http_port = 8069
import_partial =
limit_memory_hard = 2684354560
limit_memory_soft = 2147483648
limit_request = 8192
limit_time_cpu = 60
limit_time_real = 120
limit_time_real_cron = -1
list_db = True
log_db = False
log_db_level = warning
log_handler = :INFO
log_level = info
logfile = /var/log/odoo/odoo-server.log
longpolling_port = 8072
max_cron_threads = 2
osv_memory_age_limit = False
osv_memory_count_limit = False
pg_path =
pidfile =
proxy_mode = False
reportgz = False
screencasts =
screenshots = /tmp/odoo_tests
server_wide_modules = base,web
smtp_password = False
smtp_port = 25
smtp_server = localhost
smtp_ssl = False
smtp_user = False
syslog = False
test_enable = False
test_file =
test_tags = None
transient_age_limit = 1.0
translate_modules = ['all']
unaccent = False
upgrade_path =
without_demo = False
workers = 0
proxy_mode = True
longpolling_port = 8072
xmlrpc_port = 8069
xmlrpc_interface = 127.0.0.1
netrpc_interface = 127.0.0.1

workers = 17
limit_time_real = 1200
limit_time_cpu = 600

Filtrando por subdominio

dbfilter = ^%d$

Filtrando por dominio

dbfilter = ^%h$

Log en el odoo.conf

log_level = info
(choose from 'info', 'debug_rpc', 'warn', 'test', 'critical', 'runbot', 'debug_sql', 'error', 'debug', 'debug_rpc_answer', 'notset')

Ver el log

tail -f /var/log/odoo/odoo-server.log
Trae las 50 lineas antes de ese Error
grep "2021-04-28 06:55:52,330 43141" /var/log/odoo/odoo-server.log -B 50

Otra forma de instala odoo

https://github.com/Yenthe666/InstallScript

sudo wget https://raw.githubusercontent.com/Yenthe666/InstallScript/14.0/odoo_install.sh
sudo chmod +x odoo_install.sh
sudo ./odoo_install.sh

Instalación en Linux de wkhtmltopdf

Ubuntu 22.04/20.04:

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb

Ubuntu 18.04:

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb
sudo apt install ./wkhtmltox_0.12.6-1.bionic_amd64.deb

Trabajar con PyCharm y Odoo

/Users/marlonfalcon/Documents/odoo/odoo-17/odoo/odoo-bin
--config=/Users/marlonfalcon/Documents/odoo/odoo-17/odoo/debian/odoo-ee.conf -u base_bim_2 --i18n-overwrite

Ubuntu 16.04:

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.xenial_amd64.deb
sudo apt install ./wkhtmltox_0.12.6-1.xenial_amd64.deb