lambda-erp 0.1.3__tar.gz → 0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/PKG-INFO +8 -1
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/README.md +7 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/database.py +23 -1
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/pyproject.toml +1 -1
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/.gitignore +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/LICENSE +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/__init__.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/attachments.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/auth.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/bootstrap.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/chat.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/demo_limits.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/deps.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/errors.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/main.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/pdf.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/providers.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/routers/__init__.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/routers/accounting.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/routers/admin.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/routers/analytics.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/routers/bank_reconciliation.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/routers/documents.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/routers/masters.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/routers/reports.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/routers/setup.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/services.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/api/templates/document.html +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/docs/agents/README.md +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/frontend/README.md +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/frontend/src/api/client.ts +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/__init__.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/accounting/__init__.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/accounting/bank_transaction.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/accounting/budget.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/accounting/chart_of_accounts.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/accounting/general_ledger.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/accounting/journal_entry.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/accounting/payment_entry.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/accounting/pos_invoice.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/accounting/purchase_invoice.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/accounting/revaluation.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/accounting/sales_invoice.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/accounting/subscription.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/buying/__init__.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/buying/purchase_order.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/controllers/__init__.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/controllers/currency.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/controllers/defaults.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/controllers/pricing_rule.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/controllers/taxes_and_totals.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/exceptions.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/hooks.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/model.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/selling/__init__.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/selling/quotation.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/selling/sales_order.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/simulation.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/stock/__init__.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/stock/delivery_note.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/stock/purchase_receipt.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/stock/stock_entry.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/stock/stock_ledger.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/lambda_erp/utils.py +0 -0
- {lambda_erp-0.1.3 → lambda_erp-0.1.4}/terraform/README.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lambda-erp
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Core ERP logic - accounting, sales, purchasing, inventory
|
|
5
5
|
Author: TORUS INVESTMENTS AG
|
|
6
6
|
License-Expression: MIT
|
|
@@ -44,6 +44,13 @@ https://github.com/user-attachments/assets/1b2749ef-10e7-42f5-9cce-df5628292667
|
|
|
44
44
|
<a href="https://discord.gg/ZwFh9hZJTb"><img alt="Join the Lambda ERP Discord" src="https://img.shields.io/discord/1496911123029557359?color=7289DA&label=Join%20on%20Discord&logo=discord&logoColor=white&style=for-the-badge"></a>
|
|
45
45
|
</p>
|
|
46
46
|
|
|
47
|
+
The two packages publish in lockstep on every release:
|
|
48
|
+
|
|
49
|
+
<p>
|
|
50
|
+
<a href="https://pypi.org/project/lambda-erp/"><img alt="lambda-erp on PyPI" src="https://img.shields.io/pypi/v/lambda-erp?label=PyPI%20%7C%20lambda-erp&logo=pypi&logoColor=white"></a>
|
|
51
|
+
<a href="https://www.npmjs.com/package/@lambda-development/erp-core"><img alt="@lambda-development/erp-core on npm" src="https://img.shields.io/npm/v/@lambda-development/erp-core?label=npm%20%7C%20%40lambda-development%2Ferp-core&logo=npm"></a>
|
|
52
|
+
</p>
|
|
53
|
+
|
|
47
54
|
This release is not yet production-ready. It's a complete prototype but not vetted enough to run your payroll on it yet.
|
|
48
55
|
|
|
49
56
|
---
|
|
@@ -20,6 +20,13 @@ https://github.com/user-attachments/assets/1b2749ef-10e7-42f5-9cce-df5628292667
|
|
|
20
20
|
<a href="https://discord.gg/ZwFh9hZJTb"><img alt="Join the Lambda ERP Discord" src="https://img.shields.io/discord/1496911123029557359?color=7289DA&label=Join%20on%20Discord&logo=discord&logoColor=white&style=for-the-badge"></a>
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
|
+
The two packages publish in lockstep on every release:
|
|
24
|
+
|
|
25
|
+
<p>
|
|
26
|
+
<a href="https://pypi.org/project/lambda-erp/"><img alt="lambda-erp on PyPI" src="https://img.shields.io/pypi/v/lambda-erp?label=PyPI%20%7C%20lambda-erp&logo=pypi&logoColor=white"></a>
|
|
27
|
+
<a href="https://www.npmjs.com/package/@lambda-development/erp-core"><img alt="@lambda-development/erp-core on npm" src="https://img.shields.io/npm/v/@lambda-development/erp-core?label=npm%20%7C%20%40lambda-development%2Ferp-core&logo=npm"></a>
|
|
28
|
+
</p>
|
|
29
|
+
|
|
23
30
|
This release is not yet production-ready. It's a complete prototype but not vetted enough to run your payroll on it yet.
|
|
24
31
|
|
|
25
32
|
---
|
|
@@ -9,12 +9,34 @@ Schema is created from Python table definitions instead of DocType JSON files.
|
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
11
|
import datetime as _datetime
|
|
12
|
+
import os
|
|
12
13
|
import sqlite3
|
|
13
14
|
import threading
|
|
14
15
|
from contextlib import contextmanager
|
|
15
16
|
from lambda_erp.utils import _dict
|
|
16
17
|
|
|
17
18
|
|
|
19
|
+
_VALID_JOURNAL_MODES = {"WAL", "DELETE", "TRUNCATE", "PERSIST", "MEMORY", "OFF"}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _journal_mode() -> str:
|
|
23
|
+
"""SQLite journal mode for connections, from LAMBDA_ERP_SQLITE_JOURNAL_MODE.
|
|
24
|
+
|
|
25
|
+
Defaults to WAL — best for a local-disk DB (concurrent readers alongside a
|
|
26
|
+
writer). But WAL relies on a memory-mapped ``-shm`` file, so it does NOT work
|
|
27
|
+
on a network filesystem (SMB/NFS Azure Files, NFS mounts): the
|
|
28
|
+
``PRAGMA journal_mode=WAL`` itself fails with "database is locked". A
|
|
29
|
+
deployment whose DB lives on such a share must set
|
|
30
|
+
``LAMBDA_ERP_SQLITE_JOURNAL_MODE=DELETE`` — rollback-journal mode, which uses
|
|
31
|
+
only the byte-range locks the share does support. A single-writer deployment
|
|
32
|
+
(one replica, one worker) loses nothing by using DELETE. Unknown values fall
|
|
33
|
+
back to WAL. The value is validated against an allowlist before being
|
|
34
|
+
interpolated into the PRAGMA.
|
|
35
|
+
"""
|
|
36
|
+
mode = os.environ.get("LAMBDA_ERP_SQLITE_JOURNAL_MODE", "WAL").strip().upper()
|
|
37
|
+
return mode if mode in _VALID_JOURNAL_MODES else "WAL"
|
|
38
|
+
|
|
39
|
+
|
|
18
40
|
class _NullLock:
|
|
19
41
|
"""No-op context manager used when SQLite-level locking is sufficient."""
|
|
20
42
|
|
|
@@ -60,7 +82,7 @@ class Database:
|
|
|
60
82
|
"""
|
|
61
83
|
conn = sqlite3.connect(self.db_path, check_same_thread=False)
|
|
62
84
|
conn.row_factory = sqlite3.Row
|
|
63
|
-
conn.execute("PRAGMA journal_mode=
|
|
85
|
+
conn.execute(f"PRAGMA journal_mode={_journal_mode()}")
|
|
64
86
|
conn.execute("PRAGMA foreign_keys=ON")
|
|
65
87
|
# Wait up to 5s for the file lock instead of raising SQLITE_BUSY when
|
|
66
88
|
# another thread is mid-write. Generous for our workload (LLM calls
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|