A Frappe/ERPNext v16 custom app that exports accounting data to Tally Prime 4.x via native XML format, with optional direct push through Tally's built-in HTTP XML server.
| ERPNext Doctype | Tally Entity | Voucher Type |
|---|---|---|
| Account (GL) | Ledger (under mapped group) | Master |
| Customer | Ledger under Sundry Debtors | Master |
| Supplier | Ledger under Sundry Creditors | Master |
| Sales Invoice | Sales Voucher | Sales |
| Purchase Invoice | Purchase Voucher | Purchase |
| Payment Entry (Rcv) | Receipt Voucher | Receipt |
| Payment Entry (Pay) | Payment Voucher | Payment |
| Journal Entry | Journal Voucher | Journal |
| Bank Transaction | Journal Voucher | Journal |
- ERPNext v16 (Frappe v16)
- Python 3.11+
- Tally Prime 4.x running on same LAN/machine
- Tally XML Server enabled (see below)
cd /home/frappe/frappe-bench
bench get-app tally_bridge /path/to/tally_bridge
# OR if you publish it to GitHub:
# bench get-app https://github.com/yourorg/tally_bridgebench --site your-site.localhost install-app tally_bridge
bench --site your-site.localhost migrate
bench restartIn Tally Prime:
- Open your company data
- Go to Gateway of Tally → F12: Configure
- Click Advanced Configuration
- Set Enable XML Server → Yes
- Set Port → 9000 (default)
- Accept and restart Tally if prompted
Go to Tally Settings in ERPNext:
ERPNext Menu → Tally Bridge → Tally Settings
Fill in:
- Tally Host:
localhost(or the IP if Tally is on another machine) - Tally Port:
9000 - Company Name in Tally: Must exactly match the company name in Tally
- Sundry Debtors / Creditors Ledger: Must match your Tally group names
- Go to Tally Bridge Dashboard (
/tally_bridgein your browser) - Click Test Connection
- You should see a success response with company list from Tally
Navigate to /tally_bridge or Tally Bridge → Export Dashboard:
- Set your date range
- Choose format: Tally XML (recommended), Excel, or JSON
- Enable Push directly to Tally for automatic import
- Click the export card you need (or Export All)
Open any submitted Sales Invoice / Purchase Invoice / Payment Entry / Journal Entry:
- Tally → Export to Tally: pushes directly to Tally Prime
- Tally → Download XML: downloads the XML file for manual import
If you prefer to import manually:
- Download the XML file from the dashboard or document
- In Tally Prime: Gateway of Tally → Import → Data
- Select the XML file
- Choose your company
- Accept
- Enable Auto Sync in Tally Settings
- Choose interval: Hourly, Every 6 Hours, or Daily
- The scheduler will automatically push today's data to Tally
tally_bridge/
├── tally_bridge/
│ ├── api/
│ │ ├── export.py # All whitelisted API methods
│ │ └── sync.py # Scheduled sync jobs
│ ├── doctype/
│ │ ├── tally_settings/ # Single doctype for config
│ │ └── tally_export_log/ # Log of every export
│ ├── templates/
│ │ └── pages/
│ │ └── tally_bridge.html # Export dashboard UI
│ ├── public/js/
│ │ ├── sales_invoice_tally.js
│ │ └── purchase_invoice_tally.js # Also includes PE & JE
│ └── utils/
│ ├── xml_generator.py # Core Tally XML generation
│ ├── excel_exporter.py # Excel export
│ └── tally_connector.py # HTTP connector to Tally
├── hooks.py
├── setup.py
└── requirements.txt
All XML follows Tally Prime 4.x TALLYMESSAGE format:
<?xml version='1.0' encoding='UTF-8'?>
<ENVELOPE>
<HEADER>
<TALLYREQUEST>Import Data</TALLYREQUEST>
</HEADER>
<BODY>
<IMPORTDATA>
<REQUESTDESC>
<REPORTNAME>Vouchers</REPORTNAME>
<STATICVARIABLES>
<SVCURRENTCOMPANY>Your Company Name</SVCURRENTCOMPANY>
</STATICVARIABLES>
</REQUESTDESC>
<REQUESTDATA>
<TALLYMESSAGE xmlns:UDF="TallyUDF">
<!-- LEDGER or VOUCHER elements go here -->
</TALLYMESSAGE>
</REQUESTDATA>
</IMPORTDATA>
</BODY>
</ENVELOPE>ERPNext root type is mapped to Tally primary groups:
| ERPNext Root | Tally Group |
|---|---|
| Asset | Current Assets |
| Liability | Current Liabilities |
| Income | Sales Accounts |
| Expense | Indirect Expenses |
| Equity | Capital Account |
You can customise this mapping in utils/xml_generator.py → _ACCOUNT_GROUP_MAP.
- Make sure Tally Prime is open and a company is loaded
- Check that XML Server is enabled (F12 → Advanced Config in Tally)
- Check firewall — port 9000 must be accessible
- If Tally is on another machine, use its IP address, not
localhost
- Run Chart of Accounts and Customers & Suppliers exports first before voucher exports
- Tally requires ledgers to exist before vouchers that reference them
- The company name in Tally Settings must exactly match (case-sensitive) the company name as it appears in Tally Prime
- Check the Tally Export Log → Tally Response field for LINEERROR messages
- Common causes: duplicate voucher numbers, ledgers not created, date outside financial year
| Role | Dashboard | Settings | Export Log |
|---|---|---|---|
| System Manager | ✅ Full | ✅ Full | ✅ Full |
| Accounts Manager | ✅ Full | ✅ Full | ✅ Read/Write |
| Accounts User | ✅ Export | ❌ | ✅ Read |
MIT — free to use, modify, and distribute.