How logedosoft/erpnext-turkish-delight works
Project Type & Purpose
• This is an ERPNext (Frappe framework) app/plugin providing Turkish-specific customizations:
– e-Fatura/e-İrsaliye web-service integration
– Custom DocTypes and UI buttons (manual reorder, production plan)
– Fixtures and overrides for core ERPNext behavior
• It extends the ERPNext backend (Python) and frontend (client-side JS) and integrates with an external SOAP/REST e-invoice service.
High-Level Architecture Components
a. User Interface Layer
– Browser (end user)
– Frappe Desk / Web Pages (erpnextturkish/www/orderinfo.html + .py)
– Client scripts in erpnextturkish/public/js and doctype/*.js
b. Application Server Layer
– Frappe Framework + ERPNext Core
– Custom app module: erpnextturkish/
• Hooks & configuration (hooks.py, modules.txt, patches.txt)
• Python packages:
– eirsaliye/api (XML templates, utils, delivery_note.js wrapper)
– doctype controllers (e_irsaliye_ayarlar.py, efatura_ayarlar.py, etc.)
– td_utils.py, selling/api/selling_utils.py
• Fixtures loader (fixtures/*.json)
• Public assets (XML templates, build.json, SS_AUTOREORDER_BTN.mp4)
c. Persistence Layer
– MariaDB (or compatible RDBMS) storing both core ERPNext and custom DocType schemas + fixture records
d. External Services
– Turkish Government e-İrsaliye / e-Fatura SOAP or REST endpoints
– Authentication, XML payload exchange, validation responses
Relationships & Data Flow
1. User clicks a custom button in ERPNext Desk (client JS triggers) →
2. A Frappe RPC call / Server method is invoked (Python doctype controller) →
3. The controller reads/writes to Database (ORM) →
4. If e-Fatura/e-İrsaliye operation, server builds XML via api/*.xml templates and calls external SOAP endpoint →
5. Response is processed (api/utils.py), records statuses in DocType (e.g., e_irsaliye_ayarlar) →
6. Result is returned to client JS and rendered in UI.
Architectural Patterns & Principles
• MVC pattern via Frappe:
– Models: DocType definitions (.json) + Python controllers (.py)
– Views: Desk forms, HTML templates, custom web pages
– Controllers: server methods exposed to client
• Separation of concerns:
– UI scripts (public/js & doctype/*.js)
– Business logic (td_utils.py, selling/api)
– Integration logic (eirsaliye/api)
• Configuration-driven: fixtures, hooks, modules.txt register components into Frappe
Essential Elements
– Clear component labels (UI, Server modules, DB, e-Fatura Service)
– Annotations for major directories:
• erpnextturkish/public/js
• erpnextturkish/erpnext_turkish/doctype
• erpnextturkish/eirsaliye/api
• hooks.py / modules.txt