| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Point of Sale (point_of_sale)
• Discuss (mail) • Inventory (stock) • Invoicing (account) |
| Lines of code | 266 |
| Technical Name |
nz_pos_offline_cache |
| License | LGPL-3 |
| Website | https://www.nezam.co |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Point of Sale (point_of_sale)
• Discuss (mail) • Inventory (stock) • Invoicing (account) |
| Lines of code | 266 |
| Technical Name |
nz_pos_offline_cache |
| License | LGPL-3 |
| Website | https://www.nezam.co |
NZ Solutions Apps for Odoo
POS Offline Cache - Odoo 19
Keep your Odoo Point of Sale running without interruption even when the server goes offline. After loading POS once while connected, the session remains fully functional — including a complete page reload — thanks to an enhanced Service Worker that caches all static assets, API data, and translations using the browser's Cache API and IndexedDB.
What does this module provide?
NZ POS Offline Cache replaces Odoo's built-in POS Service Worker with an enhanced version that enables full offline operation even after a browser page reload. Static resources (HTML, JS, CSS, images) are stored in the Cache API. Read-only API calls (load_data, barcode reads, etc.) are cached in IndexedDB so POS can load its data while offline. Write operations (order sync, create, write) are intentionally not intercepted, letting Odoo's native offline order queue handle them correctly. Translations are stored under a stable, hash-independent key so they survive server restarts. The result: your cashiers keep selling even if the server goes down or the network drops — with no errors and no lost orders.
KEY HIGHLIGHTS
Full offline POS — even after page reload
After loading POS once while online, reloading the page while the server is down still brings up a fully functional session with no errors and no data loss.
Cache API for all static assets
All GET requests — HTML, JavaScript, CSS, and images — are stored in the browser's Cache API and served instantly when the network is unavailable.
IndexedDB cache for API responses
Read-only POST calls such as load_data and barcode reads are stored in IndexedDB and replayed automatically when the server is unreachable.
Stable translation caching
Translations are stored under a hash-independent key so they remain available after server restarts that change the URL hash — preventing interface crashes offline.
Write operations safely excluded
sync_from_ui, create, write, and unlink calls are never intercepted, so Odoo's built-in offline order queue works correctly and no order data is ever corrupted.
Immediate activation & auto-cleanup
The Service Worker activates instantly via skipWaiting and clients.claim, and automatically removes stale caches whenever a new version is deployed.
1) Server Shutdown — POS Still Works After Reload
The animation below shows the Odoo server being fully shut down while a POS session is open. After the shutdown, the browser reloads the POS page. Thanks to the enhanced Service Worker, the POS loads completely from the browser cache — no errors, no data loss — and the cashier continues processing sales entirely offline without any issues.

Does POS work offline after reloading the page?
Yes. After opening POS at least once while connected to the internet, the enhanced Service Worker caches everything needed. Reloading the page while offline loads the full POS interface from the browser cache with no errors.
Do I need to configure anything after installing the module?
No configuration is needed. Install the module, open POS at least once while online, and the Service Worker will cache everything automatically. You can then go offline or restart the server and POS will continue working.
Are orders placed offline saved correctly?
Yes. Write operations such as order synchronisation (sync_from_ui), create, write, and unlink calls are intentionally not intercepted by this module. Odoo's built-in offline order queue handles them exactly as designed, so no order data is ever lost or corrupted.
What happens to translations when the server restarts?
Odoo's translation URLs include a hash that changes on every server restart. This module stores translations under a stable, hash-independent key so the cached translations are found even after the hash changes — preventing interface crashes offline.
Which requests does the Service Worker intercept?
GET requests (HTML, JS, CSS, images) go to the Cache API. Read-only POST calls such as load_data and barcode reads go to IndexedDB. Write calls (sync_from_ui, create, write, unlink, close session, etc.) are never intercepted and pass directly to the server.
What if I have never opened POS while online?
If the browser has no cached POS page yet, an emergency offline page is shown asking you to connect at least once. After that first visit, all resources are cached and POS works fully offline on subsequent visits.
Is there any performance impact while online?
No. While connected, all requests complete normally through the network. The Service Worker updates the cache silently in the background without blocking responses, so there is no noticeable performance difference.
Which Odoo editions and deployment modes are supported?
The module is compatible with Odoo 19 Community and Enterprise on On-Premise, Odoo Online, and Odoo.sh deployments.
Version 19.0.1.1.0
Initial Release- Enhanced Service Worker replacing Odoo's built-in POS Service Worker
- Cache API caching for all static assets (HTML, JS, CSS, images)
- IndexedDB caching for read-only POST API calls (load_data, barcode reads, etc.)
- Full offline POS functionality after a single online session
- Page reload while offline fully supported without errors or data loss
- Stable hash-independent translation cache key to survive server restarts
- Write operations (sync_from_ui, create, write, unlink) intentionally excluded from interception
- Automatic cleanup of outdated nz-pos caches on Service Worker update
- Immediate Service Worker activation via skipWaiting and clients.claim
- Emergency offline fallback page for uncached navigation requests
- Empty valid translation fallback to prevent Odoo updateTranslations crash
Please log in to comment on this module