Sunday 15 March 2015

Installing Odoo v8 (OpenERP) on a Raspberry Pi

I wanted to see if the little raspberryPi would work as a POS system and I came across Odoo.  There weren't any instructions available for installing Odoo on Raspbian however there are instructions for Ubuntu - see http://www.theopensourcerer.com/2014/09/how-to-install-openerp-odoo-8-on-ubuntu-server-14-04-lts/.

I also came across a script that looked like it was meant to prepare Raspbian for an Odoo install - see https://github.com/equitania/odoo-addons/blob/master/scripts/prepare-odoo-server-raspberry.sh.

Using both resources listed above, I was able to get Odoo up and running on a Raspberry Pi Model B+ and Raspberry Pi 2.  Odoo installed on the Raspberry Pi 2 is noticeably snappier than the Model B+ (obviously), but I still think you could use the Model B+ (overclocked, turbo mode) if you have a small store and just want the ability to print receipts and record sales.  

STEPS TO INSTALLING ODOO ON A RASPBERRY PI

Step 1.  Prepare your Raspbian by ensuring the latest updates are installed and installing a bunch of packages (not sure if all packages are required or not):
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install ghostscript graphviz antiword git libpq-dev poppler-utils \
 python-pip build-essential libfreetype6-dev python-dateutil python-pypdf python-requests \
 python-feedparser python-gdata 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-zsi python-docutils python-psutil \
 python-unittest2 python-mock python-jinja2 python-dev \
 python-pdftools python-decorator python-openssl python-babel \
 python-imaging python-reportlab-accel \
 python-paramiko python-software-properties postgresql

Install Python packages:
sudo pip install passlib beautifulsoup4 evdev reportlab qrcode polib unidecode validate_email pyDNS pyserial pyusb

I had problems installing the Node app Less as the Node.js packages available from the Raspbian are older.  The solution here is to install it manually, thanks to Nathaniel Johnson (http://node-arm.herokuapp.com/).
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
sudo npm install -g less less-plugin-clean-css

WKHTML2PDF from the Raspbian repository is too old for Odoo - you'll need to compile Qt5 and wkhtml2pdf.  For now, I did without it knowing I will not be able to do some reports or reprint receipts.

Optional - tune postgreSQL:
sudo apt-get install pgtune
sudo pgtune -i /etc/postgresql/9.1/main/postgresql.conf -o /etc/postgresql/9.1/main/postgresql.conf.tuned
sudo mv /etc/postgresql/9.1/main/postgresql.conf  /etc/postgresql/9.1/main/postgresql.conf.old
sudo mv /etc/postgresql/9.1/main/postgresql.conf.tuned  /etc/postgresql/9.1/main/postgresql.conf
sudo /etc/init.d/postgresql restart

Step 2.  Create a new user "odoo" to run Odoo on your rpi (Raspberry Pi)
sudo adduser --system --home=/opt/odoo --group odoo

Step 3.  Configure the PostgreSQL database - create a new database user so that Odoo can connect to the database.
sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo

Exit once completed:  exit

Step 4:  Follow the rest of the guide from Step #5 and onwards at http://www.theopensourcerer.com/2014/09/how-to-install-openerp-odoo-8-on-ubuntu-server-14-04-lts/

Enjoy!

All credit goes to Odoo, equitania software, Nathaniel Johnson & www.theopensourcerer.com.



8 comments:

  1. Dear Percy,

    I need ur assistance to achieve this not able to do it.

    ReplyDelete
  2. did you get wkhtmltopdf 0.12 working on rpi?

    ReplyDelete
  3. Percy, it's actually a lot simpler than that. If you need POS functionality with Odoo on a Raspberry Pi, download the Posbox: https://nightly.odoo.com/master/posbox/

    ReplyDelete
  4. Thank you for your work.
    With me pip install was alittle joker : I had to install the passlib a second time as the first seem to not have been correct. And the only way to install pyusb was to use "sudo pip install pyusb --allow-external pyusb"

    ReplyDelete
  5. Great Job! =)

    Can you tell us about performances?

    I'd like to create a 1-10 users odoo v8 server with a responsive backend theme. Do you think Raspberry Pi 2 or 3 would be powerfull enough?

    Ty ;)

    ReplyDelete
  6. Hi Greg,

    I'm not experienced enough with the odoo v8 server to advise on that - I felt that there was a noticeable performance difference between the Raspberry Pi B+ and Raspberry Pi 2 with Odoo v9, and that was with only 1 user and using the web POS functions only.

    I would say give it a go anyways and see if its do-able. You can always export your odoo instance to better hardware in the future. Good luck!

    ReplyDelete
    Replies
    1. Haha I was asking because I'm not an expert on odoo or linux so exporting odoo instance would perhaps be a bit challenging for me. ^^

      In any case thanks for your answer, I'll give you some feedback if I finally try it. ;)

      Delete
  7. I just saw that my synology DS212+ NAS have odoo v8 in apps shop. From what I know it has a Marvel Kirkwood 88F6282 cpu.
    I don't find information or benchmark on "Kirkwood 88F6282 VS raspberry pi 2".
    Any clue?

    ReplyDelete