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

Monday, August 31, 2020

Debian Buster: build and install ZJ-5802 Portable Bluetooth Thermal Receipt Printer 58 mm

 

Install CUPS configurator

# apt-get install  system-config-printer

Installing ZJ-5802 Portable Bluetooth Thermal Receipt Printer driver

  1. install requirements
    # apt install build-essential cmake libcups2-dev libcupsimage2-dev
    wait, it takes some times.
  2. Download code (by click 'Code') from https://github.com/klirichek/zj-58
  3. create directory
    $ mkdir zj58master
  4. copy file
    $ cp zj-58-master.zip zj58master/
  5. extract
    $ cd zj58master/
    $ unzip zj-58-master.zip
  6. move to extraced folder
    $ cd zj-58-master/
  7. create directory to build source
    $ mkdir build
  8. move to build directory
    $ cd build/
  9. run cmake from source i.e. /home/[your_user_name]/Downloads/zj58master/zj-58-master
    $ cmake /home/dedetok/Downloads/zj58master/zj-58-master
  10. install as root from folder /home/[your_user_name]/Downloads/zj58master/zj-58-master/build
    # make install
  11. if there is no failure, you can configure your CUPS

Configure CUPS

  1. Applications -> Settings -> Print Settings
  2. Unlock printer
  3. Add (sign '+ ADD') Printer
  4. Select Device
        Devices: Unknown (Printer)
        Connection: USB
    click Forward
  5. Choose driver
        Select printer from database: Zijiang
    click Forward
        Models: Zj-58
        Drivers: Zijiang Zj-58 [en] (recommended)
    click Forward
        Leave blank on options (i.e. Cash Drawer 1, Cash Drawer 2, and Cutter. My model does not have these hardware)
    click Forward
  6. click Apply
  7. Print test page
  8. Your printer should be run properly

Reference:
https://github.com/klirichek/zj-58

odoo 13: point of sale (clean install)

First time you open odoo http://localhost:8069/web/database/selector, you need to create database for your store

Database Name    : castore
Email    : <your valid email>
Password    : ****
Phone number    :
Language    :English
Country    : Indonesia

Note: Default buildin user is "Administrator".

Note: you can select Language Indonesia if you wish
It takes sometime to complete, depend on your hardware. In my small laptop Asus Eee PC 1215B RAM 8GB, it takes about 2-3 minutes.

Configure Preferences
go to Administrator (drop down) -> Preferences
Timezone    : Asia/Jakarta
and save.

Configure your company (store),
go to Settings -> Users & Companies -> Companies -> My Company -> Edit
Company Name    : <your company/store>
Currency    : IDR
and Save.

Add Apps, go to Apps
Apps -> Point of Sale -> Install (will install Inventory and Invoicing)
Apps -> Sales -> Install

Configure products
Inventory -> Master Data -> Products -> Create
Product Name    : lacquer isamu 250 gram
    Can be Sold
    Can be Purchased
General Information
    Product Type    : Storable Product
    Product Category    : All
    Sales Price    : 30000
    Cost    : 20000
To add picture/icon, at camera icon click Edit
Then click On Hand -> Create
On Hand Quantity    : 10000
and Save.
Edit your previous product (i.e. lacquer isamu 250 gram)
Point of Sale
    Available in POS: checked
    Category -> Create and Edit
        Category Name: iron putty
        Parent Category: <blank>
        and save.
and save.


Try your Point of Sale
Point of Sale -> New Session
lacquer isamu 250 gram
change Qty (quantity) to 2.
change Price to 25000
make Payment -> Cash
Tendered: 60000
Validate and you can print reciept.

Done. You can now add more products to sell.
 

Reference:
https://www.planet-odoo.com/odoo-13-point-of-sale-a-complete-guide-to-point-of-sales-features-payments-pricing/

Wednesday, August 26, 2020

odoo 13: install on Debian 10.5

Install PostgreSQL
# apt-get install postgresql

Install package wkhtmltopdf
# apt-get install wkhtmltopdf

Install package python3-xlwt
# apt-get install python3-xlwt

Install package python3-num2words
# apt-get install python3-num2words

Add odoo 13 repository and install
1. download repository key and install
# wget https://nightly.odoo.com/odoo.key
# apt-key add odoo.key
2. add odoo 13 to /etc/apt/sources.list
...
# odoo
deb http://nightly.odoo.com/13.0/nightly/deb/ ./
3. update your repository
# apt-get update
4. install odoo 13
# apt-get install odoo

My complete /etc/apt/sources.list
# security
deb http://security.debian.org/debian-security buster/updates main

# main
deb http://kartolo.sby.datautama.net.id/debian/ buster main

# non free
deb http://httpredir.debian.org/debian buster main contrib non-free

# backport
deb http://ftp.debian.org/debian buster-backports main

# odoo
deb http://nightly.odoo.com/13.0/nightly/deb/ ./

Note: nightly build will release everyday, If you don't need to update it daily, you may comment out odoo in /etc/apt/sources.list.

After finish, you can open your odoo using firefox http://localhost:8069/.

Reference:
https://www.odoo.com/documentation/13.0/setup/install.html