Skip to Content

Improving Odoo POS, Part 1: Extending Offline Capabilities

Improving it, but we made a mistake. Our offline POS deleted 14 paid orders accidentally.
October 31, 2026 by
Michael


See our video demo here.


Odoo's point of sale handles a dropped connection fine. When a session opens, it loads products, customers and prices into the browser, queues orders locally while the line is down, and syncs them when it comes back. That's enough for a router reboot. BUT it won't boot a register with no server, and it can't close a shift that never saw the internet.

Our client needed both. They run twenty-six registers across six branches with about 15,000 products, on cashier PCs as small as a Celeron with 4 GB of RAM. Shifts last 12 hours in Chrome kiosk mode. Baskets run 20 to 100 items. Some branches are in remote areas where power and internet can go out for hours even days, so the target was a register that sells through a full day offline, loses nothing, and can eventually close its shift without the server.

What we built first

A service worker serves the POS app from cache, so a cashier can reload the page with the cable unplugged. The catalog and every order live in the browser's IndexedDB. Orders sync when the connection returns, and Odoo gives each one a server ID.

Until that ID arrives, the copy in IndexedDB is the only record of a paid sale anywhere.

We shipped it.

Then, a couple of months later, a register closed its shift with more money in the drawer than the system had recorded.

The 25th of June

Cash, debit and QRIS were all above the system totals. We traced it and found that fourteen consecutive orders were missing, from roughly 08:23 to 09:15, and three sources agreed on the gap: the Excel export jumped from order 0003 to 0018, the server log showed 0003 as that register's last synced order, and the register's IndexedDB held only orders from that evening.

The cause was in our module. A cleanup routine ran every 20 minutes and deleted any paid order older than 30 minutes, assuming it had synced by then. During the outage it hadn't. Those 14 orders lived only in the browser. The routine removed them, and Chrome's storage engine later compacted its files and took the leftovers too.

The first fix was a single condition: delete an order only after the server has given it a numeric ID. Then we asked why the cleanup existed at all. Someone had added it for performance, but Odoo already clears synced orders from that store, and a later patch had fixed the performance problem another way. The timer could only ever catch the orders nobody else had saved, so we removed it.

Getting the 14 orders back was worse. Both cache files were partly corrupted. Product names were readable in the raw bytes and amounts weren't, so there is no reconstruction. That one branch must do stock count and their accountant must write the difference. We fully take the blame for it.

What we rebuilt

The rebuild treats the browser like the register's hard disk.

Every paid order now goes into an append-only ledger with strict durability before the receipt screen appears. Our code never deletes from that ledger. Its sync status gets updated in place. The only way to delete it is a recovery page that requires an export first and a typed confirmation phrase. Odoo's own journal keeps just the working set of open baskets and paid orders the server hasn't confirmed, and a paid order leaves it only when the server confirms it. The 20-minute timer is gone.

Sync got stricter. If the server hasn't answered in 3 seconds, the cashier moves on and the order is marked UNKNOWN while the request keeps running. Before any retry, the register asks the server which of those UUIDs it already has. A slow line can't turn one sale into two, and a unique index on the order UUID in Postgres catches anything that slips through.

When something does break, a recovery page at /pos_offline/recovery reads both databases straight off the cashier PC, even if the POS itself won't start, and exports them to JSON.

Our recovery page on a test register, demo data.

For the longest outages, the next step is a small local server in each branch, and that needs the client's decision and budget.

If your offline POS loses orders

Before anyone touches the machine, compare three things: the order sequence in your export, the last synced order per register in the server log, and what's left in that register's IndexedDB. Do it before anyone clears browser storage or reinstalls Chrome, because compaction erases deleted records for good.

Then search your custom modules for anything that deletes orders on a timer, and check that every deletion waits for a server-side ID. Test with the network cable pulled.

Part 2 is about speed: how our pos_lite modules keeps the same register responsive through a 12-hour shift.

Need an Odoo POS that keeps selling through a long outage? Write to us and tell us what happened. You'll get a written reply within two working days.