lambda-erp 0.2.3__tar.gz → 0.2.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.2.3 → lambda_erp-0.2.4}/PKG-INFO +1 -1
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/routers/masters.py +16 -3
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/pyproject.toml +1 -1
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/.gitignore +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/LICENSE +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/README.md +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/__init__.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/attachments.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/auth.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/bootstrap.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/chat.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/demo_limits.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/deps.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/errors.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/main.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/oauth.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/pdf.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/providers.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/remarks_md.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/routers/__init__.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/routers/accounting.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/routers/admin.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/routers/analytics.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/routers/bank_reconciliation.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/routers/chat_api.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/routers/documents.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/routers/proposals.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/routers/reports.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/routers/setup.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/services.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/templates/document.html +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/api/templates/proposal.html +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/docs/agents/README.md +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/frontend/README.md +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/frontend/src/api/client.ts +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/__init__.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/__init__.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/bank_transaction.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/budget.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/chart_of_accounts.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/general_ledger.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/journal_entry.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/payment_entry.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/pos_invoice.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/purchase_invoice.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/revaluation.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/sales_invoice.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/setup/__init__.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/setup/engine.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/setup/pack.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/setup/packs/__init__.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/setup/packs/ch.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/setup/packs/de_common.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/setup/packs/de_skr03.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/setup/packs/de_skr04.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/setup/packs/generic.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/setup/profiles.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/setup/spine.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/accounting/subscription.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/buying/__init__.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/buying/purchase_order.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/controllers/__init__.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/controllers/currency.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/controllers/defaults.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/controllers/pricing_rule.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/controllers/taxes_and_totals.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/database.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/exceptions.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/hooks.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/model.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/selling/__init__.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/selling/proposal.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/selling/quotation.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/selling/sales_order.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/simulation.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/stock/__init__.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/stock/delivery_note.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/stock/purchase_receipt.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/stock/stock_entry.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/stock/stock_ledger.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/lambda_erp/utils.py +0 -0
- {lambda_erp-0.2.3 → lambda_erp-0.2.4}/terraform/README.md +0 -0
|
@@ -388,8 +388,16 @@ def delete_master(master_type: str, name: str, _user: dict = _admin):
|
|
|
388
388
|
|
|
389
389
|
|
|
390
390
|
@router.get("/account/tree")
|
|
391
|
-
def account_tree(company: str | None = None,
|
|
392
|
-
|
|
391
|
+
def account_tree(company: str | None = None, include_disabled: bool = False,
|
|
392
|
+
_user: dict = _viewer):
|
|
393
|
+
"""Return Chart of Accounts as a nested tree.
|
|
394
|
+
|
|
395
|
+
Disabled accounts are hidden by default (they already drop out of account
|
|
396
|
+
pickers, and a disabled account is one the user retired). Pass
|
|
397
|
+
``include_disabled=true`` to show them. A disabled *group* is still shown if
|
|
398
|
+
it has any enabled descendant, so an active account is never hidden behind a
|
|
399
|
+
disabled parent. Each node carries a ``disabled`` bool for the UI.
|
|
400
|
+
"""
|
|
393
401
|
db = get_db()
|
|
394
402
|
filters = {}
|
|
395
403
|
if company:
|
|
@@ -398,7 +406,7 @@ def account_tree(company: str | None = None, _user: dict = _viewer):
|
|
|
398
406
|
"Account",
|
|
399
407
|
filters=filters if filters else None,
|
|
400
408
|
fields=["name", "account_name", "parent_account", "root_type",
|
|
401
|
-
"report_type", "account_type", "is_group"],
|
|
409
|
+
"report_type", "account_type", "is_group", "disabled"],
|
|
402
410
|
)
|
|
403
411
|
|
|
404
412
|
by_parent = {}
|
|
@@ -411,7 +419,12 @@ def account_tree(company: str | None = None, _user: dict = _viewer):
|
|
|
411
419
|
result = []
|
|
412
420
|
for acc in children:
|
|
413
421
|
node = dict(acc)
|
|
422
|
+
node["disabled"] = bool(acc.get("disabled"))
|
|
414
423
|
node["children"] = _build(acc["name"])
|
|
424
|
+
# Prune a disabled node only when nothing enabled survives beneath it,
|
|
425
|
+
# so an enabled child is never dropped along with its disabled parent.
|
|
426
|
+
if not include_disabled and node["disabled"] and not node["children"]:
|
|
427
|
+
continue
|
|
415
428
|
result.append(node)
|
|
416
429
|
return result
|
|
417
430
|
|
|
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
|
|
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
|