How oca/pos works
1. This repository is an OCA addon collection for Odoo 18.0 Point of Sale. Architecturally, it is not one application but a set of independent extension modules that all plug into the same Odoo backend and POS frontend.
2. The common structure across modules is consistent: Python models for server-side behavior, XML views for backend UI/settings, JavaScript/XML assets for POS client changes, translation files, and tests. Each addon is isolated by its own __manifest__.py, so features can be installed independently.
3. The main runtime boundary is between the Odoo server and the browser-based POS client. Backend modules extend persistent models such as pos.config, pos.session, pos.order, product.product, sale.order, res.users, and payment-method models; frontend modules extend the OWL POS app through ESM JavaScript overrides and QWeb/XML templates.
4. A large group of addons only changes POS presentation or interaction on the client side. Examples include order summary tweaks (pos_display_order_number, pos_display_total_quantity, pos_divide_order_summary), line controls (pos_order_remove_line), barcode/lot interactions (pos_lot_barcode, pos_barcode_rule_priced_with_change_rate), product display/search enhancements (pos_product_display_default_code, pos_product_multi_barcode, pos_supplierinfo_search), and partner list info (pos_customer_tree_view_vat).
5. Another group extends configuration and data loading from Odoo settings into the POS session. Modules such as pos_config_logo, pos_margin, pos_order_remove_line, pos_user_restriction, and pos_barcode_rule_priced_with_change_rate add fields on pos.config and related settings models, then make those values available when the POS is loaded.
6. Some addons affect core POS business flows on the server. pos_margin computes and stores margin-related information for orders and reports; pos_sale_picking_keep alters how POS orders interact with sale pickings; pos_order_to_sale_order creates or maps POS orders into sales orders and sales lines; pos_session_pay_invoice adds invoice payment handling through a wizard and session logic.
7. Session lifecycle and closing are a distinct subsystem. pos_blind_session_closing changes the closing popup and hides cash-control details in the frontend, while pos_report_session_summary adds a session summary PDF/reporting path on the backend. These modules sit at the boundary between operational session data and user-facing cash reconciliation/reporting.
8. There is one explicit hardware/service integration: pos_payment_method_cashdro. It extends POS payment methods and sessions to communicate with CashDro terminals, so the data flow includes the POS UI, Odoo session/payment models, and an external payment device.
9. Security and user access are modeled separately where needed. pos_user_restriction adds access rules so users can only see/use certain POSes, and pos_user_restrict_provider_info hides supplier/provider information from non-POS users in the frontend. These modules combine backend security records with frontend visibility rules.
10. Testing is split along the same boundary as the implementation. Server-side Python tests validate models, workflows, and security; frontend tests and tours exercise the POS browser app and its UI overrides. That separation is important for architecture diagrams because it shows which behavior belongs to the backend database-driven layer versus the interactive client layer.
11. Tooling is repo-wide and supports multi-addon maintenance: GitHub Actions run pre-commit and tests, with linting via Ruff/Pylint and frontend formatting/linting via ESLint/Prettier. Translation catalogs exist per addon, reinforcing that each module is deployable and localizable on its own.
12. For an architecture diagram, the key boxes are: Odoo server core, addon-specific backend models/views/security, POS browser app assets, optional external device integration, and test/CI infrastructure. The arrows mainly run from backend configuration and ORM data into the POS client, and from client actions back into Odoo session/order/payment records.
Main entry points: test.yml CI tools · pos_security.xml User access · order_summary.esm.js Order number · pos_config.py Config logo
Components 21
Odoo server
Backend ORM, views, security, reports, and session/order/payment extensions.
- Config logo · Adds POS config and settings fields plus receipt-header client data.
pos_config_logo/models/pos_config.py - Margin · Extends POS orders, reports, and UI to compute and display margin data.
pos_margin/models/pos_config.py - POS to sale · Maps POS orders into sale orders and adds client controls for creation flow.
pos_order_to_sale_order/models/sale_order.py - Pay invoice · Adds invoice payment handling through session models and a wizard.
pos_session_pay_invoice/models/pos_session.py - User access · Restricts which POSes users can access via models and security rules.
pos_user_restriction/security/pos_security.xml - Session summary · Adds backend session summary reporting and PDF output.
pos_report_session_summary/views/session_summary_report.xml
POS browser
OWL-based POS client customizations, templates, and tours.
- Order number · Shows order numbers in the POS order summary.
pos_display_order_number/static/src/js/overrides/screens/order_summary/order_summary.esm.js - Total quantity · Displays total quantities in the order summary.
pos_display_total_quantity/static/src/js/overrides/screens/order_summary/order_summary.esm.js - Split summary · Reworks order-summary presentation with template-only frontend changes.
pos_divide_order_summary/static/src/xml/pos_divide_order_summary.xml - Remove line · Adds order-line removal interaction and related config gating.
pos_order_remove_line/static/src/js/orderline.esm.js - Lot barcode · Extends product screen and popup flows for lot/barcode interaction.
pos_lot_barcode/static/src/js/Screens/ProductScreen.esm.js - Default code · Shows product default codes in POS search and display.
pos_product_display_default_code/static/tests/tours/product_screen_tour.esm.js - Multi barcode · Loads multiple barcodes into the POS product store.
pos_product_multi_barcode/static/src/app/store/product_product.esm.js - Supplier search · Adds supplier-info lookup to POS product search and store data.
pos_supplierinfo_search/static/src/js/product_product.esm.js - Customer VAT · Adds VAT visibility to partner list and partner line templates.
pos_customer_tree_view_vat/static/src/xml/partner_list_screen.xml - Blind closing · Hides cash-control details and customizes the session-closing popup.
pos_blind_session_closing/static/src/js/closing_popup.esm.js - Provider info · Hides supplier/provider information from restricted POS users.
pos_user_restrict_provider_info/static/src/js/pos_store.esm.js
Integrations
External payment device and server-to-client data flows.
- CashDro · Links payment methods and sessions to an external CashDro terminal.
pos_payment_method_cashdro/models/pos_payment_method.py
Quality
Repository-wide linting, tests, and CI workflows.
- CI tools · Pre-commit, linting, and test workflows that validate all addons.
.github/workflows/test.yml
Other components
- Odoo core · Shared Odoo 18.0 backend and POS application boundary all addons extend.
- Addon packs · Independent installable OCA addons, each with its own manifest and translations.
README.md
Connections 27
- Odoo core → Addon packs: hosts · The repository is a suite of Odoo addons built on the shared Odoo runtime.
- Odoo core → Config logo: loads · Backend extension adds POS config data exposed to the client.
- Odoo core → Margin: loads · Extends order persistence and margin reporting on the server.
- Odoo core → POS to sale: loads · Creates and synchronizes sale orders from POS orders.
- Odoo core → Pay invoice: loads · Adds session-level invoice payment handling.
- Odoo core → User access: loads · Applies user access restrictions in the backend.
- Odoo core → CashDro: loads · Integrates payment method models with an external terminal.
- Odoo core → Session summary: loads · Publishes backend reports for POS session summaries.
- Odoo core → Order number: serves · Frontend assets override POS order-summary rendering.
- Odoo core → Total quantity: serves · Frontend assets override POS order-summary rendering.
- Odoo core → Split summary: serves · Frontend templates adjust order-summary layout.
- Odoo core → Remove line: serves · Frontend code changes order-line interaction.
- Odoo core → Lot barcode: serves · Frontend code adds lot/barcode scanning flows.
- Odoo core → Default code: serves · Frontend assets enrich product display and search behavior.
- Odoo core → Multi barcode: serves · Frontend store extension loads extra barcodes.
- Odoo core → Supplier search: serves · Frontend store extension exposes supplier information for search.
- Odoo core → Customer VAT: serves · Frontend templates augment partner browsing.
- Odoo core → Blind closing: serves · Frontend popup and store changes customize session closing.
- Odoo core → Provider info: serves · Frontend visibility rules hide provider details.
- Config logo → Order number: feeds · Configuration and loaded data flow into the POS client.
- Margin → Total quantity: feeds · Server-computed values and config influence client presentation.
- CashDro → Blind closing: interacts · Both touch session/payment closing behavior at the POS boundary.
- User access → Provider info: constrains · Backend access restrictions pair with frontend visibility filtering.
- Pay invoice → Session summary: adjacent · Session payment and session summary logic meet at closing/reporting.
- CI tools → Addon packs: validates · Repo-wide CI runs linting and tests across independent addons.
- CI tools → Order number: tests · Frontend tours and tests exercise POS browser behavior.
- CI tools → User access: tests · Server-side tests validate ORM and security behavior.