Sunday, September 20, 2020

Debian Buster: install pgadmin4 (fresh postgresql 11)

  1. Download apt key https://www.pgadmin.org/static/packages_pgadmin_org.pub and add key
    # wget https://www.pgadmin.org/static/packages_pgadmin_org.pub
    # apt-key add packages_pgadmin_org.pub
  2. Create and append pgadmin4 repository
    # echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list
  3. Run update & install pgadmin4-desktop
    # apt-get update
    # apt-get install pgadmin4-desktop

By default postgres user has no password in database (not system). You need to set/change postgres database password. From root linux shell
# su - postgres
$ psql
# \password
<type_your_password>

Try login to your postgres using psql
$ psql -U postgres  -h localhost
Password for user postgres:
psql (11.7 (Debian 11.7-0+deb10u1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.
postgres=#

After running pgadmin4, pgadmin4 server will started and the first time you need to create master password (NOTE: master password is password to use pgadmin4).

Connect to your local postgresql server

  1. From your browser http://127.0.0.1:41271/browser/, Add New Server
  2. Fill
    1. Connection: localhost (your connection name)
    2. Port: 5432
    3. Maintenance Database: postgres
    4. Username: postgres
    5. Password: <your password>
  3. and Save

Reference:
https://www.pgadmin.org/download/pgadmin-4-apt/

 

Sunday, September 6, 2020

odoo 13: FATAL: role "odoo" does not exist

symptom:

# tail /var/log/odoo/odoo-server.log
...
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  role "odoo" does not exist - - -

Solution:

1. su as postgres user in your Debian

# su - postgres

2. run psql

$ psql
psql (11.7 (Debian 11.7-0+deb10u1))
Type "help" for help.

3. create role odoo to connect and exit

postgres=# create role odoo login createdb;
CREATE ROLE
postgres=# \q

Thursday, September 3, 2020

odoo 13: install on low end laptop Fujitsu MH330 Intel(R) Atom(TM) CPU N455 @ 1.66GHz RAM 2GB (Maximum)

 

Guide: Worker number calculation

    Rule of thumb : (#CPU * 2) + 1
    Cron workers need CPU
    1 worker ~= 6 concurrent users

cpu: 1 core (1 core 2 thread) Intel(R) Atom(TM) CPU N455 @ 1.66GHz
workers = 2+1

CPU time needs to be loonger to finish the task, we triple it.

Configuration:

workers = 3
;max_cron_threads = 2 ;default
;limit_time_cpu = 60 ;default
;limit_time_real = 120 ;default
max_cron_threads = 1
limit_time_cpu = 240
limit_time_real = 360

To install pos module, follow these sequence:

  1. Inventory
  2. Invoicing
  3. POS

Reference:

  • https://gist.github.com/Guidoom/d5db0a76ce669b139271a528a8a2a27f
  • https://www.odoo.com/documentation/13.0/setup/deploy.html