# tahait1995/pos_mrp_integration architecture

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

- Interactive diagram: https://gitdiagram.com/tahait1995/pos_mrp_integration
- Repository: https://github.com/tahait1995/pos_mrp_integration

## Overview

This Odoo add-on turns POS sales of configured manufactured products into traceable Manufacturing Orders. The main flow is product setup and POS loading, cashier-side BOM validation, backend order and stock validation, payment confirmation, then one MO per order line with optional auto-confirmation. Product indicators, availability checks, batch-sync isolation, and order/session/MO navigation are included. The POS order excerpt is partial, so uncertain internal helper calls and UI-to-view wiring are omitted.

Main entry points: [`models/pos_order.py`](https://github.com/tahait1995/pos_mrp_integration/blob/main/models/pos_order.py) (POS Order Processing), [`models/product_template.py`](https://github.com/tahait1995/pos_mrp_integration/blob/main/models/product_template.py) (Product Configuration), [`static/src/js/pos_mrp.js`](https://github.com/tahait1995/pos_mrp_integration/blob/main/static/src/js/pos_mrp.js) (POS Order Validation), [`models/mrp_production.py`](https://github.com/tahait1995/pos_mrp_integration/blob/main/models/mrp_production.py) (Manufacturing Orders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Product Setup"]
  node_product_config["Product Configuration"]
  node_product_views["Product Forms"]
  node_bom[("Bills of Materials")]
end

subgraph group_pos["POS Sales"]
  node_pos_session["POS Session Loader<br/>[pos_session.py]"]
  node_pos_card["Product Status Card"]
  node_pos_order_ui["POS Order Validation<br/>[pos_mrp.js]"]
  node_pos_backend["POS Order Processing<br/>[pos_order.py]"]
  node_stock[("Stock Availability")]
end

subgraph group_production["Manufacturing Traceability"]
  node_pos_order_views["Order Traceability<br/>[pos_order_view.xml]"]
  node_production["Manufacturing Orders<br/>[mrp_production.py]"]
  node_mrp_views["MO Traceability"]
  node_session_views["Session MO List"]
end

node_cashier(("Cashier"))
node_odoo_mrp["Odoo MRP"]

node_cashier -->|"views products"| node_pos_card
node_pos_session -->|"loads POS flags"| node_product_config
node_pos_card -->|"adds product"| node_pos_order_ui
node_pos_order_ui -->|"submits payment"| node_pos_backend
node_pos_order_ui -->|"shows validation"| node_cashier
node_pos_backend -->|"checks configuration"| node_product_config
node_product_config -->|"selects BOM"| node_bom
node_pos_backend -->|"validates BOM"| node_bom
node_pos_backend -->|"checks availability"| node_stock
node_pos_backend -->|"creates and confirms MOs"| node_odoo_mrp
node_pos_backend -->|"links order lines"| node_production
node_production -->|"exposes order links"| node_pos_order_views
node_production -->|"shows POS origin"| node_mrp_views
node_pos_session -->|"provides MO count"| node_session_views
node_product_views -->|"configures manufacturing"| node_product_config

click node_product_config "https://github.com/tahait1995/pos_mrp_integration/blob/main/models/product_template.py"
click node_product_views "https://github.com/tahait1995/pos_mrp_integration/blob/main/views/product_template_view.xml"
click node_pos_session "https://github.com/tahait1995/pos_mrp_integration/blob/main/models/pos_session.py"
click node_pos_card "https://github.com/tahait1995/pos_mrp_integration/blob/main/static/src/js/pos_product_screen.js"
click node_pos_order_ui "https://github.com/tahait1995/pos_mrp_integration/blob/main/static/src/js/pos_mrp.js"
click node_pos_backend "https://github.com/tahait1995/pos_mrp_integration/blob/main/models/pos_order.py"
click node_pos_order_views "https://github.com/tahait1995/pos_mrp_integration/blob/main/views/pos_order_view.xml"
click node_production "https://github.com/tahait1995/pos_mrp_integration/blob/main/models/mrp_production.py"
click node_mrp_views "https://github.com/tahait1995/pos_mrp_integration/blob/main/views/mrp_production_view.xml"
click node_session_views "https://github.com/tahait1995/pos_mrp_integration/blob/main/views/pos_session_view.xml"

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_product_config,node_product_views,node_bom toneBlue
class node_pos_session,node_pos_card,node_pos_order_ui,node_pos_backend,node_stock toneAmber
class node_pos_order_views,node_production,node_mrp_views,node_session_views toneMint
class node_cashier,node_odoo_mrp toneIndigo
```

## Components

### Product Setup

- [Product Configuration](https://github.com/tahait1995/pos_mrp_integration/blob/main/models/product_template.py): `models/product_template.py`
- [Product Forms](https://github.com/tahait1995/pos_mrp_integration/blob/main/views/product_template_view.xml): `views/product_template_view.xml`
- **Bills of Materials**

### POS Sales

- [POS Session Loader](https://github.com/tahait1995/pos_mrp_integration/blob/main/models/pos_session.py): `models/pos_session.py`
- [Product Status Card](https://github.com/tahait1995/pos_mrp_integration/blob/main/static/src/js/pos_product_screen.js): `static/src/js/pos_product_screen.js`
- [POS Order Validation](https://github.com/tahait1995/pos_mrp_integration/blob/main/static/src/js/pos_mrp.js): `static/src/js/pos_mrp.js`
- [POS Order Processing](https://github.com/tahait1995/pos_mrp_integration/blob/main/models/pos_order.py): `models/pos_order.py`
- **Stock Availability**

### Manufacturing Traceability

- [Order Traceability](https://github.com/tahait1995/pos_mrp_integration/blob/main/views/pos_order_view.xml): `views/pos_order_view.xml`
- [Manufacturing Orders](https://github.com/tahait1995/pos_mrp_integration/blob/main/models/mrp_production.py): `models/mrp_production.py`
- [MO Traceability](https://github.com/tahait1995/pos_mrp_integration/blob/main/views/mrp_production_view.xml): `views/mrp_production_view.xml`
- [Session MO List](https://github.com/tahait1995/pos_mrp_integration/blob/main/views/pos_session_view.xml): `views/pos_session_view.xml`

### Other components

- **Cashier**
- **Odoo MRP**

## Connections

- Cashier → Product Status Card: views products
- POS Session Loader → Product Configuration: loads POS flags
- Product Status Card → POS Order Validation: adds product
- POS Order Validation → POS Order Processing: submits payment
- POS Order Validation → Cashier: shows validation
- POS Order Processing → Product Configuration: checks configuration
- Product Configuration → Bills of Materials: selects BOM
- POS Order Processing → Bills of Materials: validates BOM
- POS Order Processing → Stock Availability: checks availability
- POS Order Processing → Odoo MRP: creates and confirms MOs
- POS Order Processing → Manufacturing Orders: links order lines
- Manufacturing Orders → Order Traceability: exposes order links
- Manufacturing Orders → MO Traceability: shows POS origin
- POS Session Loader → Session MO List: provides MO count
- Product Forms → Product Configuration: configures manufacturing
