Skip to content

PRD — djangoerp

Product requirements for DjangoERP — the problem, target users, goals, current features and open questions — with anything the sources do not state marked TBD.

Derived from the README, agent docs, config and code in bamr87/djangoerp. Anything not stated in those sources is marked TBD; success metrics are proposals. Open work is tracked in GitHub Issues, the backlog of record.

1. Overview / problem

A Django 6 + Django REST Framework ERP built outward from a double-entry accounting core into a modular enterprise system supporting order-to-cash, procure-to-pay and make-to-stock. The financial core was consolidated from amrs-project; supply-chain and planning modules re-implement designs from ERPNext, Odoo, Tryton, InvenTree and frePPLe.

1.1 Missions

Django ERP's direction is to become the ultimate open home for all things enterprise resource planning — data, tools, resources and transparency, gathered in one place that anyone can inspect and reuse.

  1. Provide data, tools, resources and transparency for all stakeholders, finance and operations professionals, and the general public. Operators, accountants, developers and anyone studying how an ERP should work are first-class audiences. The aim is a shared, inspectable commons: the same ledger, the same modules, and the same API for everyone.
  2. Grow a modular, API-first ERP outward from a double-entry accounting core, covering order-to-cash, procure-to-pay and make-to-stock, with a ledger that stays auditable. Chart of accounts, journal entries, invoices and payments, inventory, purchasing, sales, manufacturing and MRP planning should compose as open Django apps rather than a monolith no one can read.
  3. Keep that system open and comparable: Django and Django REST Framework, modular apps, and designs that can be studied against established open ERPs rather than locked behind a vendor. The financial core, consolidated from earlier work, and supply-chain and planning modules informed by open-source predecessors, should remain something a practitioner can inspect, extend and teach from.

These missions set the course; they do not claim the work is finished. They serve the PRD's scope: a Django 6 and Django REST Framework ERP built outward from a double-entry core into a modular enterprise system.

Requirement

  • MR1: Constitution §1 states one direction statement and exactly three numbered missions, and the README and AGENTS.md taglines match that direction and link to constitution §1.

Feature DJERP-009 traces to requirement MR1.

2. Target users

  • Small/medium businesses or developers needing an API-first ERP backend
  • ERP consultants prototyping processes

3. Goals and non-goals

Goals

  • Correct double-entry postings with enforced invariants
  • End-to-end O2C, P2P and make-to-stock flows
  • A documented JWT-authenticated REST API

Non-goals

  • A full end-user UI: TBD (not described in README)

4. Core features (current)

  • Apps: accounts, coa, company, core, journal, invoices, reports, partners, products, inventory, purchasing, sales, manufacturing, mrp
  • Multi-warehouse stock ledger with moving-average costing
  • BOMs, work orders and an MRP planning engine
  • Async financial reports via Celery
  • Swagger/ReDoc API docs
  • Docker / docker-compose with PostgreSQL
  • An agent simulation sandbox: AI and heuristic agents drive the ERP through its services over simulated time, a browser console exposes the books, operations, agent decisions and controls, and what-if experiments compare variants without touching the live books

Feature catalog

Every user-facing capability has a stable id in the feature catalog features/features.yml. Each entry names the PRD requirements it serves (prd:); the trace below is the reverse view.

ID Feature Status Where Requirements
DJERP-001 Apps: accounts, coa, company, core, journal, invoices,… shipped djangoerp/urls.py · README.md TBD
DJERP-002 Multi-warehouse stock ledger with moving-average costing shipped inventory/models.py · README.md TBD
DJERP-003 BOMs, work orders and an MRP planning engine shipped mrp/engine.py · README.md TBD
DJERP-004 Async financial reports via Celery shipped djangoerp/celery.py · README.md TBD
DJERP-005 Swagger/ReDoc API docs shipped djangoerp/urls.py · README.md TBD
DJERP-006 Docker / docker-compose with PostgreSQL shipped docker-compose.yml · README.md TBD
DJERP-007 Reversing entries for posted journal entries shipped journal/services.py · docs/ARCHITECTURE.md FR3
DJERP-008 Fiscal periods, lock dates and period-close entry planned journal/models.py · docs FR4
DJERP-009 Constitution missions planned docs/constitution.md · PRD.md MR1
DJERP-010 Landing page with setup steps, API map and feedback widget shipped route / · README.md TBD
DJERP-011 Agent simulation sandbox shipped simulation/engine.py · simulation/README.md FR5, FR6
DJERP-012 Claude-driven agents with bounded decisions shipped simulation/brains.py · docs/adr/0003-agent-simulation-sandbox.md FR7
DJERP-013 Simulation console shipped route /console/ · simulation/README.md FR8
DJERP-014 What-if experiments shipped simulation/experiments.py · simulation/README.md FR9
DJERP-015 Labor and overhead absorption in work-order completion shipped manufacturing/services.py · docs/adr/0002-absorb-conversion-costs-into-finished-goods.md FR10
DJERP-016 Workspace app shell shipped route /app/ · workspace/README.md FR11
DJERP-017 Document flow, accounting and stock impact shipped workspace/services.py · workspace/README.md FR12
DJERP-018 Global search, work queues and statements in the shell shipped route /app/finance/statements/ · workspace/README.md FR13

Requirement → feature trace

Requirement Features
TBD DJERP-001, DJERP-002, DJERP-003, DJERP-004, DJERP-005, DJERP-006, DJERP-010
FR3 DJERP-007
FR4 DJERP-008
MR1 DJERP-009
FR5 DJERP-011
FR6 DJERP-011
FR7 DJERP-012
FR8 DJERP-013
FR9 DJERP-014
FR10 DJERP-015
FR11 DJERP-016
FR12 DJERP-017
FR13 DJERP-018

5. Requirements

Functional

  • FR1: Every business document posts balanced journal entries per the posting matrix (docs/ARCHITECTURE.md)
  • FR2: API authenticated via JWT
  • FR3: Posted journal entries can be corrected by a reversing entry that is idempotent, linked to the original and audit-logged (shipped — POST /api/journal/entries/{id}/reverse/, #44, DJERP-007)
  • FR4: Fiscal periods and a lock date block postings into closed periods, and period close posts P&L to retained earnings (planned — #45, DJERP-008)
  • FR5: A sandbox simulation advances a time-stepped economy whose agents — market, customers, suppliers, managers, line crews, machines, maintenance and the controller — act only through the ERP's services, and only on a database flagged as a sandbox (DJERP-011)
  • FR6: Every simulated tick leaves the trial balance and balance sheet balanced and the stock, receivables, payables and fixed-asset subledgers reconciled with the GL; a tick that unbalances the books is rolled back and halts the scenario (DJERP-011)
  • FR7: Agents can be driven by a small Claude model whose decisions are bounded, clamped and audited, with a heuristic fallback when the model is unavailable or answers invalidly, and every call's cost posted to the ledger (DJERP-012)
  • FR8: A browser console shows the live financial statements, operations, agent decisions with document-to-journal tracing and the system design, and exposes every simulation parameter as a control (DJERP-013)
  • FR9: What-if experiments compare a baseline and a variant, such as adding a production line, from the current state on common random numbers without changing the live books (DJERP-014)
  • FR10: Work-order completion can absorb labor and overhead into finished-goods value while the stock ledger and the GL stay equal (DJERP-015)
  • FR11: One app shell gives every module a consistent navigation, sign-in, global search, list, record and form pattern, built only on the public API, with what each role sees and can do derived from the API's own permission classes (DJERP-016)
  • FR12: Any business document shows its lifecycle, its lines, the documents before and after it in its flow, the journal entries it posted and the stock moves it made, and its audit trail, each section limited to what the role may read (DJERP-017)
  • FR13: A user can find any document, partner or product from one search, see the work waiting on them as queues, and read the financial statements from the report generators inside the shell (DJERP-018)

Non-functional

  • NFR1: Python ≥ 3.12, Django 6.1
  • NFR2: Containerized deployment
  • NFR3: Security/compliance requirements (audit, SoD): TBD

6. Success metrics (proposed — not defined in sources)

  • Test coverage of posting invariants
  • API response times: TBD

7. Roadmap / open questions

  • Multi-currency, tax and localization scope: TBD