# oca/pos architecture

> Architecture diagram of the GitHub repository oca/pos, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oca/pos
- Repository: https://github.com/oca/pos

## Overview

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: [`.github/workflows/test.yml`](https://github.com/oca/pos/blob/18.0/.github/workflows/test.yml) (CI tools), [`pos_user_restriction/security/pos_security.xml`](https://github.com/oca/pos/blob/18.0/pos_user_restriction/security/pos_security.xml) (User access), [`pos_display_order_number/static/src/js/overrides/screens/order_summary/order_summary.esm.js`](https://github.com/oca/pos/blob/18.0/pos_display_order_number/static/src/js/overrides/screens/order_summary/order_summary.esm.js) (Order number), [`pos_config_logo/models/pos_config.py`](https://github.com/oca/pos/blob/18.0/pos_config_logo/models/pos_config.py) (Config logo)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_server["Odoo server"]
  node_pos_config_logo["Config logo<br/>backend addon<br/>[pos_config.py]"]
  node_pos_margin["Margin<br/>backend addon<br/>[pos_config.py]"]
  node_pos_order_to_sale_order["POS to sale<br/>workflow addon<br/>[sale_order.py]"]
  node_pos_session_pay_invoice["Pay invoice<br/>session addon<br/>[pos_session.py]"]
  node_pos_user_restriction["User access<br/>security addon<br/>[pos_security.xml]"]
  node_pos_report_session_summary["Session summary<br/>report addon"]
end

subgraph group_group_frontend["POS browser"]
  node_pos_display_order_number["Order number<br/>POS ui addon"]
  node_pos_display_total_quantity["Total quantity<br/>POS ui addon"]
  node_pos_divide_order_summary["Split summary<br/>POS ui addon"]
  node_pos_order_remove_line["Remove line<br/>POS ui addon<br/>[orderline.esm.js]"]
  node_pos_lot_barcode["Lot barcode<br/>POS scanning addon"]
  node_pos_product_display_default_code["Default code<br/>POS product addon"]
  node_pos_product_multi_barcode["Multi barcode<br/>POS product addon"]
  node_pos_supplierinfo_search["Supplier search<br/>POS product addon"]
  node_pos_customer_tree_view_vat["Customer VAT<br/>POS list addon"]
  node_pos_blind_session_closing["Blind closing<br/>session ui addon"]
  node_pos_user_restrict_provider_info["Provider info<br/>visibility addon<br/>[pos_store.esm.js]"]
end

subgraph group_group_integration["Integrations"]
  node_pos_payment_method_cashdro["CashDro<br/>device integration"]
end

subgraph group_group_quality["Quality"]
  node_ci_tools["CI tools<br/>repo tooling<br/>[test.yml]"]
end

node_odoo_core["Odoo core<br/>runtime platform"]
node_addon_pattern["Addon packs<br/>module collection<br/>[README.md]"]

node_odoo_core -->|"hosts"| node_addon_pattern
node_odoo_core -->|"loads"| node_pos_config_logo
node_odoo_core -->|"loads"| node_pos_margin
node_odoo_core -->|"loads"| node_pos_order_to_sale_order
node_odoo_core -->|"loads"| node_pos_session_pay_invoice
node_odoo_core -->|"loads"| node_pos_user_restriction
node_odoo_core -->|"loads"| node_pos_payment_method_cashdro
node_odoo_core -->|"loads"| node_pos_report_session_summary
node_odoo_core -->|"serves"| node_pos_display_order_number
node_odoo_core -->|"serves"| node_pos_display_total_quantity
node_odoo_core -->|"serves"| node_pos_divide_order_summary
node_odoo_core -->|"serves"| node_pos_order_remove_line
node_odoo_core -->|"serves"| node_pos_lot_barcode
node_odoo_core -->|"serves"| node_pos_product_display_default_code
node_odoo_core -->|"serves"| node_pos_product_multi_barcode
node_odoo_core -->|"serves"| node_pos_supplierinfo_search
node_odoo_core -->|"serves"| node_pos_customer_tree_view_vat
node_odoo_core -->|"serves"| node_pos_blind_session_closing
node_odoo_core -->|"serves"| node_pos_user_restrict_provider_info
node_pos_config_logo -.->|"feeds"| node_pos_display_order_number
node_pos_margin -.->|"feeds"| node_pos_display_total_quantity
node_pos_payment_method_cashdro -.->|"interacts"| node_pos_blind_session_closing
node_pos_user_restriction -.->|"constrains"| node_pos_user_restrict_provider_info
node_pos_session_pay_invoice -.->|"adjacent"| node_pos_report_session_summary
node_ci_tools -->|"validates"| node_addon_pattern
node_ci_tools -->|"tests"| node_pos_display_order_number
node_ci_tools -->|"tests"| node_pos_user_restriction

click node_addon_pattern "https://github.com/oca/pos/blob/18.0/README.md"
click node_pos_config_logo "https://github.com/oca/pos/blob/18.0/pos_config_logo/models/pos_config.py"
click node_pos_margin "https://github.com/oca/pos/blob/18.0/pos_margin/models/pos_config.py"
click node_pos_order_to_sale_order "https://github.com/oca/pos/blob/18.0/pos_order_to_sale_order/models/sale_order.py"
click node_pos_session_pay_invoice "https://github.com/oca/pos/blob/18.0/pos_session_pay_invoice/models/pos_session.py"
click node_pos_user_restriction "https://github.com/oca/pos/blob/18.0/pos_user_restriction/security/pos_security.xml"
click node_pos_payment_method_cashdro "https://github.com/oca/pos/blob/18.0/pos_payment_method_cashdro/models/pos_payment_method.py"
click node_pos_report_session_summary "https://github.com/oca/pos/blob/18.0/pos_report_session_summary/views/session_summary_report.xml"
click node_pos_display_order_number "https://github.com/oca/pos/blob/18.0/pos_display_order_number/static/src/js/overrides/screens/order_summary/order_summary.esm.js"
click node_pos_display_total_quantity "https://github.com/oca/pos/blob/18.0/pos_display_total_quantity/static/src/js/overrides/screens/order_summary/order_summary.esm.js"
click node_pos_divide_order_summary "https://github.com/oca/pos/blob/18.0/pos_divide_order_summary/static/src/xml/pos_divide_order_summary.xml"
click node_pos_order_remove_line "https://github.com/oca/pos/blob/18.0/pos_order_remove_line/static/src/js/orderline.esm.js"
click node_pos_lot_barcode "https://github.com/oca/pos/blob/18.0/pos_lot_barcode/static/src/js/Screens/ProductScreen.esm.js"
click node_pos_product_display_default_code "https://github.com/oca/pos/blob/18.0/pos_product_display_default_code/static/tests/tours/product_screen_tour.esm.js"
click node_pos_product_multi_barcode "https://github.com/oca/pos/blob/18.0/pos_product_multi_barcode/static/src/app/store/product_product.esm.js"
click node_pos_supplierinfo_search "https://github.com/oca/pos/blob/18.0/pos_supplierinfo_search/static/src/js/product_product.esm.js"
click node_pos_customer_tree_view_vat "https://github.com/oca/pos/blob/18.0/pos_customer_tree_view_vat/static/src/xml/partner_list_screen.xml"
click node_pos_blind_session_closing "https://github.com/oca/pos/blob/18.0/pos_blind_session_closing/static/src/js/closing_popup.esm.js"
click node_pos_user_restrict_provider_info "https://github.com/oca/pos/blob/18.0/pos_user_restrict_provider_info/static/src/js/pos_store.esm.js"
click node_ci_tools "https://github.com/oca/pos/blob/18.0/.github/workflows/test.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pos_config_logo,node_pos_margin,node_pos_order_to_sale_order,node_pos_session_pay_invoice,node_pos_user_restriction,node_pos_report_session_summary toneBlue
class node_pos_display_order_number,node_pos_display_total_quantity,node_pos_divide_order_summary,node_pos_order_remove_line,node_pos_lot_barcode,node_pos_product_display_default_code,node_pos_product_multi_barcode,node_pos_supplierinfo_search,node_pos_customer_tree_view_vat,node_pos_blind_session_closing,node_pos_user_restrict_provider_info toneAmber
class node_pos_payment_method_cashdro toneMint
class node_ci_tools toneRose
class node_odoo_core,node_addon_pattern toneNeutral
```

## Components

### Odoo server

Backend ORM, views, security, reports, and session/order/payment extensions.

- [Config logo](https://github.com/oca/pos/blob/18.0/pos_config_logo/models/pos_config.py): backend addon · Adds POS config and settings fields plus receipt-header client data. · `pos_config_logo/models/pos_config.py`
- [Margin](https://github.com/oca/pos/blob/18.0/pos_margin/models/pos_config.py): backend addon · Extends POS orders, reports, and UI to compute and display margin data. · `pos_margin/models/pos_config.py`
- [POS to sale](https://github.com/oca/pos/blob/18.0/pos_order_to_sale_order/models/sale_order.py): workflow addon · Maps POS orders into sale orders and adds client controls for creation flow. · `pos_order_to_sale_order/models/sale_order.py`
- [Pay invoice](https://github.com/oca/pos/blob/18.0/pos_session_pay_invoice/models/pos_session.py): session addon · Adds invoice payment handling through session models and a wizard. · `pos_session_pay_invoice/models/pos_session.py`
- [User access](https://github.com/oca/pos/blob/18.0/pos_user_restriction/security/pos_security.xml): security addon · Restricts which POSes users can access via models and security rules. · `pos_user_restriction/security/pos_security.xml`
- [Session summary](https://github.com/oca/pos/blob/18.0/pos_report_session_summary/views/session_summary_report.xml): report addon · 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](https://github.com/oca/pos/blob/18.0/pos_display_order_number/static/src/js/overrides/screens/order_summary/order_summary.esm.js): POS ui addon · 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](https://github.com/oca/pos/blob/18.0/pos_display_total_quantity/static/src/js/overrides/screens/order_summary/order_summary.esm.js): POS ui addon · Displays total quantities in the order summary. · `pos_display_total_quantity/static/src/js/overrides/screens/order_summary/order_summary.esm.js`
- [Split summary](https://github.com/oca/pos/blob/18.0/pos_divide_order_summary/static/src/xml/pos_divide_order_summary.xml): POS ui addon · Reworks order-summary presentation with template-only frontend changes. · `pos_divide_order_summary/static/src/xml/pos_divide_order_summary.xml`
- [Remove line](https://github.com/oca/pos/blob/18.0/pos_order_remove_line/static/src/js/orderline.esm.js): POS ui addon · Adds order-line removal interaction and related config gating. · `pos_order_remove_line/static/src/js/orderline.esm.js`
- [Lot barcode](https://github.com/oca/pos/blob/18.0/pos_lot_barcode/static/src/js/Screens/ProductScreen.esm.js): POS scanning addon · Extends product screen and popup flows for lot/barcode interaction. · `pos_lot_barcode/static/src/js/Screens/ProductScreen.esm.js`
- [Default code](https://github.com/oca/pos/blob/18.0/pos_product_display_default_code/static/tests/tours/product_screen_tour.esm.js): POS product addon · Shows product default codes in POS search and display. · `pos_product_display_default_code/static/tests/tours/product_screen_tour.esm.js`
- [Multi barcode](https://github.com/oca/pos/blob/18.0/pos_product_multi_barcode/static/src/app/store/product_product.esm.js): POS product addon · Loads multiple barcodes into the POS product store. · `pos_product_multi_barcode/static/src/app/store/product_product.esm.js`
- [Supplier search](https://github.com/oca/pos/blob/18.0/pos_supplierinfo_search/static/src/js/product_product.esm.js): POS product addon · Adds supplier-info lookup to POS product search and store data. · `pos_supplierinfo_search/static/src/js/product_product.esm.js`
- [Customer VAT](https://github.com/oca/pos/blob/18.0/pos_customer_tree_view_vat/static/src/xml/partner_list_screen.xml): POS list addon · Adds VAT visibility to partner list and partner line templates. · `pos_customer_tree_view_vat/static/src/xml/partner_list_screen.xml`
- [Blind closing](https://github.com/oca/pos/blob/18.0/pos_blind_session_closing/static/src/js/closing_popup.esm.js): session ui addon · Hides cash-control details and customizes the session-closing popup. · `pos_blind_session_closing/static/src/js/closing_popup.esm.js`
- [Provider info](https://github.com/oca/pos/blob/18.0/pos_user_restrict_provider_info/static/src/js/pos_store.esm.js): visibility addon · 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](https://github.com/oca/pos/blob/18.0/pos_payment_method_cashdro/models/pos_payment_method.py): device integration · 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](https://github.com/oca/pos/blob/18.0/.github/workflows/test.yml): repo tooling · Pre-commit, linting, and test workflows that validate all addons. · `.github/workflows/test.yml`

### Other components

- **Odoo core**: runtime platform · Shared Odoo 18.0 backend and POS application boundary all addons extend.
- [Addon packs](https://github.com/oca/pos/blob/18.0/README.md): module collection · Independent installable OCA addons, each with its own manifest and translations. · `README.md`

## Connections

- 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.
