erp

package
v1.801.455 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package erp declares the ERPNext-core business model as DocType fixtures on the framework engine (apps/framework). Like apps/cms, ERP is NOT a bespoke subsystem and mounts NO HTTP surface of its own: an ERP master (Item, Customer, Account…) IS a framework DocType in module "erp", a transaction (Sales Order, Sales Invoice, Stock Entry…) IS a submittable framework document with child Tables, and posting IS a Go lifecycle hook (RegisterHook) that appends immutable ledger documents. All CRUD, permissions, tenant isolation, install, submit/cancel docstatus, and rendering are the framework's generic, already-live surface (/v1/framework/*) and the SAME generic @hanzo/ui DocType renderer that draws CMS. This package only DECLARES the fixtures and the native-Go business hooks and registers them with the engine at init — the ONE source of truth for the ERP model, per-org on Base/SQLite.

It does not ship today. No binary imports it — not plugin/framework, not the host — so its init never runs, the "erp" module is never registered, and POST /v1/framework/modules/erp/install answers for a module the engine has never heard of. Linking it into plugin/framework is the whole activation.

This is the second app lane on the framework (CMS was the first), proving the thesis: one engine + one renderer renders every business app. It reuses the generic install path (POST /v1/framework/modules/erp/install) and the generic renderer verbatim; the only ERP-specific code is data (fixtures) and behavior (hooks) — zero UI, zero forked engine.

Naming (all names are slug-clean so the generic renderer can reach them)

  • DocType names are slug-style with an "erp-" prefix, so they never collide with the CMS lane's names (Author/Media/Page/…) or the CRM's, and never carry a space that the console's `/cloud` path filter would reject.
  • Transactional documents use a SERIES autoname ("erp-so-.#####" → "erp-so-00001"), always slug-clean and monotonic per org.
  • Masters use a field autoname ("field:item_code" …); the console slugifies the naming field on write (savePayload), so the document name is always URL-safe.
  • Ledger entries are hash-named (system-posted, never addressed by a human key).

Index

Constants

View Source
const Module = "erp"

Module is the framework module tag every ERP DocType carries. The console's ERP surface is the generic DocType renderer scoped to this module.

View Source
const RoleErpUser = "Erp User"

RoleErpUser is the operational ERP role the master/transaction DocTypes grant read/write/create/delete/submit/cancel. The org owner (System Manager, seeded trust-on-first-use) assigns it via /v1/framework/roles; a role-less member stays denied (secure by default). The immutable ledgers (GL, stock) are System-Manager read-only — accounting truth is widened to other roles only by explicit grant.

Variables

This section is empty.

Functions

func DocTypes

func DocTypes() []framework.DocType

DocTypes returns the canonical ERP model — the default DocTypes an org gets when it installs the ERP lane. Order is child-schemas first for readability, but the engine resolves Link/Table targets at document write (not at define), so the set is order-independent; install creates them all before any document is written.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL