Tobias Brunner de848c5b31 | ||
---|---|---|
contrib | ||
deployment | ||
docs | ||
iotbox | ||
odoo | ||
.gitignore | ||
LICENSE | ||
README.md | ||
docker-compose.yml |
README.md
Odoo Pos Distribution
Dockerfiles, Docker Compose and Kubernetes configuration for running an Odoo based PoS in container and Kubernets.
Quickstart
Docker Compose
docker-compose up
Continue with "Odoo PoS configuration"
Kubernetes / K3s
The provided YAML files have been developed and tested with k3s on amd64 and arm64.
Installation will happen in the namespace pos
.
- Install k3s (any other Kubernetes should work as well)
- Install local-path-provisioner
- Apply the deployment YAMLs:
kubectl apply -f deployment/
Continue with "Odoo PoS configuration"
Odoo PoS configuration
- Connect to Odoo and create a new database
On Kubernetes the Ingress defines the hostnames
pos
andiotbox
- Install Odoo Apps:
- "Point of Sale"
- "POS Network Printer"
- (Enable "Developer mode" under Odoo settings)
- Configure PoS for IoT Box (see docs/iotbox-config.png)
- Configure Order Printer (see docs/orderprinter.png)
Odoo Addons
The default addons from Odoo core are not enough for a smooth PoS experience, therefore a good amount of other PoS addons can be used. This distributions adds the following addon sources:
- pos-addons:
hw_printer_network
&&pos_printer_network
: Support for network receipt printer
- odoo-cloud-platform:
monitoring_status
: Status endpoint for Odoo
- CybroAddons:
pos_product_category_filter
: Only show selected product categories on the PoS view
The following addons are delivered in this repository:
ip_pos_ticket_order_number
: Custom made module to print a big order number both on the receipt and kitchen orderpos_product_sequence
: Commercial module to manually order products (default is alphabetically). You're not allowed to use this module unless you bought it as well. See POS Product Sequence on the Odoo app store.
Hardware and Networking
- Default network assumed:
192.168.233.0/24
- Printers: 192.168.233.3 and 192.168.233.5
- Printers used in this project: Epson TM-T20II
More hardware description and a network diagram: tbd.
Monitoring
There are two kinds of monitoring prepared: The cluster itself and the PoS application.
Simple Cluster Healthcheck
Under contrib/healthchecks-cronjob.yaml
a simple Kubernetes cronjob is
provided which regularly pings Healthchecks.io.
A secret with the ping URL needs to be added before the CronJobs does it's work:
kubectl -n posmon create secret generic healthchecks-io --from-literal=HCURL=https://hc-ping.com/MYUUID
Application and network monitoring
Application monitoring is done using Prometheus, Alertmanager and Blackbox exporter. No application specific exporters are used, so it's just a base monitoring to answer the question: "Is it up?".
- Install prometheus-operator
F.e.:
kubectl apply -f https://raw.githubusercontent.com/coreos/prometheus-operator/master/bundle.yaml
- Apply manifests:
kubectl apply -f contrib/posmon/
- Create secret for extra scrape config:
kubectl -n posmon create secret generic additional-scrape-configs --from-file=contrib/pos-blackbox-exporter-scrape.yaml
- Create secret for Alertmanager config:
kubectl -n posmon create secret generic alertmanager-posmon --from-file=contrib/alertmanager.yaml
Backup
Backup is done using K8up.
- Install K8up
- Apply manifests under
contrib/backup
Restore
tbd...
createdb -T template0 restoretest
pg_restore -d restoretest /data/odoo_data.dump
Notes
- Connection from PoS Tablet to IoT Box is a direct connection, not via Odoo server!
- Support for opening the cashbox via network printer has been patched. The IP is hardcoded to 192.168.233.3. See 0c6ecfdd and #730.
Docker Images
Docker images are automatically built on Docker Hub (for amd64 arch).
docker.io/tobru/odoo-pos:latest-iotbox
: IoT Boxdocker.io/tobru/odoo-pos:latest-pos
: Odoo
A word on ARM / Raspberry Pi support
TL;DR: It's not easy to run things out of the box on Raspberry Pi.
Images for ARM64 (f.e. Raspberry Pi) are not automatically built as this is not supported by Docker Hub. They are built manually on a Raspberry Pi and uploaded to Docker Hub.
docker.io/tobru/odoo-pos:latest-iotbox-arm64v7
: IoT Boxdocker.io/tobru/odoo-pos:latest-pos-arm64v7
: Odoo
As the upstream Odoo doesn't support
linux/arm/v7
even the base image needs to be built on the Raspberry Pi:
- Clone https://github.com/odoo/docker
- Change
wkhtmltox
to installraspbian.stretch_armhf.deb
- Build with
docker build -t local/odoo:12 .
- Patch local Dockerfiles to use this as base image
A good amount of upstream stuff doesn't work on Raspberry Pi as no multiarch images are provided. F.e. the proposed monitoring stack with Prometheus doesn't work out of the box and K8up doesn't provide arm binaries (yet).
The Postgres client installed in the Odoo images is version 9.6 (it's based
on Debian Stretch and upstream doesn't provide armhf
packages).
If you're using a newer Postgres version, the DB management functionality of
Odoo (Backup/Restore) won't work because of version mismatch.
TODOs
Distribution
- Pre-install
monitoring_status
and use for K8s probes - Point Blackbox Monitoring to
/monitoring/status
- Tweak monitoring rules
- Mirror important add-ons to this repository
- Configure
server_wide_modules
(instead of using command line parameters)- Odoo:
base,web,monitoring_status
- Automatically install PoS modules
- Odoo:
- Improve arm builds and overall support (Monitoring, Backup)
- Support for adding third-party commercial Odoo addons
PoS Usage
- Configure default payment option
- Don't open cash drawer for virtual payment (Twint, SumUp)
- Possibility to print a kitchen order ticket per position (not summarized)
Disclaimer
This is a hobby project and is not actively maintained. I don't provide any support! If you feel like contributing something, that's of course appreciated. Feel free to open a Pull Request.