Skip to content

Commit a838b00

Browse files
elarrobapablokillinstreakshucontech
authored
v0.7.9 (#277)
* v.0.7.7 * Enhance account list views and update icon styles. Implemented dynamic page titles and subtitles for account pages by overriding `get_context_data`. Updated template text and classes for greater consistency, including standardizing icon colors for active, locked, and default roles. * Adding TransactionModel attributes during commit_txs. * Fixed a couple of hard coded dollar "$" symbols and changed them with `{% currency_symbol %}` tag to render the correct symbol when `DJANGO_LEDGER_CURRENCY_SYMBOL` is other than default ("$"). (#265) * Dependency update * Update contribution guidelines in README and Contribute.md Clarified the types of pull requests that are encouraged, emphasizing those that address bug fixes, enhancements, or valuable additions. Added a note discouraging submissions focused only on cosmetic changes like linting or refactoring. * Update ManyToManyField configurations and bump version to 0.7.8 Adjusted `ManyToManyField` relationships in `BillModel`, `InvoiceModel`, and `PurchaseOrderModel` to include `through` and `through_fields` for `ItemTransactionModel`. Incremented package version to `0.7.8`. * Add support for bank account type validation and retrieval based on OFX standards - Introduced `bank_account_type` field in `BankAccountModel` with predefined choices. - Added methods to retrieve routing number, account type, and account type validation in `OFXImport` class. - Enhanced account queries with a new `.cash()` method to filter accounts with `ASSET_CA_CASH` role. - Updated indexing and unique constraints for `BankAccountModel`. * Migration Update * Refactor bank account type handling and account type mapping logic - Replaced `BankAccountModel.BANK_ACCOUNT_TYPES` with explicit OFX types. - Renamed `ACCOUNT_TYPE_ROLE_MAPPING` to `ACCOUNT_TYPE_DEFAULT_ROLE_MAPPING`. - Centralized OFX type mappings in `ACCOUNT_TYPE_OFX_MAPPING`. - Removed `bank_account_type` field from `BankAccountModel`. - Added `get_account_type_from_ofx` method for retrieving account type from OFX data. * Add financial institution field and utility methods to account models - Introduced `financial_institution` field in account mixin for storing bank details. - Added `get_account_last_digits` utility for partial account number retrieval. - Implemented `can_hide` and `can_unhide` methods in `BankAccountModel`. * Refactor account handling and enhance validation methods - Renamed `get_account_type` to `get_ofx_account_type` for clarity in OFX implementation. - Added `get_account_type` method to map OFX account types to internal account types. - Introduced `get_routing_last_digits` method for masked routing number retrieval. - Improved handling of missing account and routing numbers in utility methods. * Sort node issue fix * Update chart_of_accounts.py * Bump version to 0.7.9 and update `for_entity` method to accept `EntityModel` instances. --------- Co-authored-by: Pablo Santa Cruz <[email protected]> Co-authored-by: killinstreak <[email protected]> Co-authored-by: Shucon Tech <[email protected]>
1 parent 411a6dc commit a838b00

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

django_ledger/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
default_app_config = 'django_ledger.apps.DjangoLedgerConfig'
77

88
"""Django Ledger"""
9-
__version__ = '0.7.8'
9+
__version__ = '0.7.9'
1010
__license__ = 'GPLv3 License'
1111

1212
__author__ = 'Miguel Sanda'

django_ledger/models/accounts.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,6 @@ class AccountModelAbstract(MP_Node, CreateUpdateMixIn):
439439
on_delete=models.CASCADE,
440440
verbose_name=_('Chart of Accounts'))
441441
objects = AccountModelManager()
442-
node_order_by = ['uuid']
443442

444443
class Meta:
445444
abstract = True

django_ledger/models/data_import.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"""
1313

1414
from decimal import Decimal
15-
from typing import Optional, Set, Dict, List
15+
from typing import Optional, Set, Dict, List, Union
1616
from uuid import uuid4, UUID
1717

1818
from django.core.exceptions import ValidationError
@@ -24,6 +24,7 @@
2424

2525
from django_ledger.io import ASSET_CA_CASH, CREDIT, DEBIT
2626
from django_ledger.models import JournalEntryModel
27+
from django_ledger.models.entity import EntityModel
2728
from django_ledger.models.mixins import CreateUpdateMixIn
2829
from django_ledger.models.utils import lazy_loader
2930

@@ -128,8 +129,12 @@ def for_user(self, user_model):
128129

129130
)
130131

131-
def for_entity(self, entity_slug: str, user_model):
132+
def for_entity(self, entity_slug: Union[EntityModel, str], user_model):
132133
qs = self.for_user(user_model)
134+
if isinstance(entity_slug, EntityModel):
135+
return qs.filter(
136+
Q(bank_account_model__entity_model=entity_slug)
137+
)
133138
return qs.filter(
134139
Q(bank_account_model__entity_model__slug__exact=entity_slug)
135140
)

django_ledger/models/entity.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,6 @@ class EntityModelAbstract(MP_Node,
787787
meta = models.JSONField(default=dict, null=True, blank=True)
788788
objects = EntityModelManager.from_queryset(queryset_class=EntityModelQuerySet)()
789789

790-
node_order_by = ['uuid']
791790

792791
class Meta:
793792
abstract = True

django_ledger/models/unit.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ class EntityUnitModelAbstract(MP_Node,
136136
hidden = models.BooleanField(default=False, verbose_name=_('Is Hidden'))
137137

138138
objects = EntityUnitModelManager.from_queryset(queryset_class=EntityUnitModelQuerySet)()
139-
node_order_by = ['uuid']
140139

141140
class Meta:
142141
abstract = True

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "django-ledger"
3-
version = "0.7.8"
3+
version = "0.7.9"
44
readme = "README.md"
55
requires-python = ">=3.10"
66
description = "Double entry accounting system built on the Django Web Framework."

0 commit comments

Comments
 (0)