Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.7.0 #228

Merged
merged 25 commits into from
Oct 25, 2024
Merged

v0.7.0 #228

merged 25 commits into from
Oct 25, 2024

Conversation

elarroba
Copy link
Member

Significant refactoring and optimization of the Accounts Model modules.

elarroba and others added 24 commits April 18, 2024 13:51
* fix: initial attempt

* Allow .qfx files in data_import form.

The accept attribute in the file-input field now includes .qfx files. This permits users to import data from files in .qfx format in addition to the previously supported .ofx format.

* remove debugging lines, remove debug code, add sample ofx for tests

---------

Co-authored-by: Miguel Sanda <[email protected]>
* Add proxy functions to JournalEntry model

The commit introduces proxy functions to the JournalEntry model in the Django Ledger code. Specifically, it adds 'post', 'unpost', 'lock', and 'unlock' methods, each serving as a proxy to their counterpart methods 'mark_as_posted', 'mark_as_unposted', 'mark_as_locked', and 'mark_as_unlocked'. This simplifies the interface for interacting with JournalEntry objects.

* Minor code optimization & Django Ledger admin fields.

* access the queryset instance using .all() which returns a queryset. (#213)

* Correct urls for going back in entity and ledger balance sheet view (#215)

* Add signal handling for various models' statuses

Added signals for different status changes of Django Ledger models to enable real-time, event-driven system behavior. Signals are now sent each time an action is performed in the Ledger, Invoice, Bill, Journal Entry, Purchase Order, and Estimate. These changes will allow us to trigger specific actions depending on these changes.

* Update Python version and package versions in Pipfile

Updated the Python version from 3.11 to 3.12 in Pipfile and Pipfile.lock. Also, updated the package versions of 'django', 'faker' and 'pillow' in Pipfile.lock for improved functionality and security.

* Update Django Ledger version to 0.6.3

This commit updates the version number of the Django Ledger project in both __init__.py and pyproject.toml files. The version has been incremented from 0.6.2 to 0.6.3.

* Update signal comments in models

Updated the comments in the signals.py file to clearly specify that the signals correspond to Journal Entry Models. Additional context was also included for the signals module to enhance clarity for developers in understanding the importance of events or states in the models.

* Update documentation structure

Rearrange sections in documentation, focusing on IO and models. For docs/source/models.rst, the automodule section for django_ledger.models.signals was added. Meanwhile, in docs/source/io.rst, sections were reshuffled and terms updated for better clarity. These steps aim to enhance documentation readability and accuracy.

---------

Co-authored-by: Eric paul <[email protected]>
Co-authored-by: Ubaid ur Rehman <[email protected]>
Upgraded several packages to their latest versions, including Faker, Alabaster, and SQLParse, among others. Added new dependencies appnope and backports.tarfile, and adjusted Python version markers for some packages. Removed cryptography and jeepney from the list of dependencies.
Bump the version number in `__init__.py` and `pyproject.toml`. This update ensures consistency and readiness for the next release cycle.
* access the queryset instance using .all() which returns a queryset.

* fixed invalid client

* changes in API authentication usage

* API Authentication usage
Introduced a detailed Jupyter notebook for DjangoCon 2024. This notebook demonstrates various functionalities including setting up Django, creating a UserModel, defining an EntityModel, and creating and populating a Chart of Accounts.
Enhanced the entity model to handle various types for CoA (Chart of Accounts) input. Cleared execution counts and outputs from DjangoCon2024 notebook for better clarity.
Implemented `VALID_PARENTS` to allow filtering accounts based on hierarchical roles. This ensures that parent-child relationships between account roles are correctly validated and managed.
Refactored and enhanced documentation for AccountModel and its related query sets to ensure clarity and consistency. Introduced detailed attribute descriptions and method explanations while maintaining code functionality.
Introduced a new `net_income` method to calculate and store net income as part of the IO_DATA digest process. Updated the `digest` method to include the net income calculation step. This enhances the financial reporting capabilities of the middleware.
* v0.6.4 (#223)

* Relaxing Dependency Constraints

* Issue 208 ofx files (#209)

* fix: initial attempt

* Allow .qfx files in data_import form.

The accept attribute in the file-input field now includes .qfx files. This permits users to import data from files in .qfx format in addition to the previously supported .ofx format.

* remove debugging lines, remove debug code, add sample ofx for tests

---------

Co-authored-by: Miguel Sanda <[email protected]>

* v0.6.3 (#214)

* Add proxy functions to JournalEntry model

The commit introduces proxy functions to the JournalEntry model in the Django Ledger code. Specifically, it adds 'post', 'unpost', 'lock', and 'unlock' methods, each serving as a proxy to their counterpart methods 'mark_as_posted', 'mark_as_unposted', 'mark_as_locked', and 'mark_as_unlocked'. This simplifies the interface for interacting with JournalEntry objects.

* Minor code optimization & Django Ledger admin fields.

* access the queryset instance using .all() which returns a queryset. (#213)

* Correct urls for going back in entity and ledger balance sheet view (#215)

* Add signal handling for various models' statuses

Added signals for different status changes of Django Ledger models to enable real-time, event-driven system behavior. Signals are now sent each time an action is performed in the Ledger, Invoice, Bill, Journal Entry, Purchase Order, and Estimate. These changes will allow us to trigger specific actions depending on these changes.

* Update Python version and package versions in Pipfile

Updated the Python version from 3.11 to 3.12 in Pipfile and Pipfile.lock. Also, updated the package versions of 'django', 'faker' and 'pillow' in Pipfile.lock for improved functionality and security.

* Update Django Ledger version to 0.6.3

This commit updates the version number of the Django Ledger project in both __init__.py and pyproject.toml files. The version has been incremented from 0.6.2 to 0.6.3.

* Update signal comments in models

Updated the comments in the signals.py file to clearly specify that the signals correspond to Journal Entry Models. Additional context was also included for the signals module to enhance clarity for developers in understanding the importance of events or states in the models.

* Update documentation structure

Rearrange sections in documentation, focusing on IO and models. For docs/source/models.rst, the automodule section for django_ledger.models.signals was added. Meanwhile, in docs/source/io.rst, sections were reshuffled and terms updated for better clarity. These steps aim to enhance documentation readability and accuracy.

---------

Co-authored-by: Eric paul <[email protected]>
Co-authored-by: Ubaid ur Rehman <[email protected]>

* Update dependencies versions in Pipfile.lock

Upgraded several packages to their latest versions, including Faker, Alabaster, and SQLParse, among others. Added new dependencies appnope and backports.tarfile, and adjusted Python version markers for some packages. Removed cryptography and jeepney from the list of dependencies.

* Updated Logos

* comment out attribute that doesn't exist (#220)

* Docker Fix (#218)

* Update version to 0.6.4

Bump the version number in `__init__.py` and `pyproject.toml`. This update ensures consistency and readiness for the next release cycle.

* API authentication (#217)

* access the queryset instance using .all() which returns a queryset.

* fixed invalid client

* changes in API authentication usage

* API Authentication usage

* Add DjangoCon2024 Jupyter notebook example

Introduced a detailed Jupyter notebook for DjangoCon 2024. This notebook demonstrates various functionalities including setting up Django, creating a UserModel, defining an EntityModel, and creating and populating a Chart of Accounts.

* Update entity model CoA handling and streamline notebook

Enhanced the entity model to handle various types for CoA (Chart of Accounts) input. Cleared execution counts and outputs from DjangoCon2024 notebook for better clarity.

* Add support for validating parent roles in accounts

Implemented `VALID_PARENTS` to allow filtering accounts based on hierarchical roles. This ensures that parent-child relationships between account roles are correctly validated and managed.

* Pipfile Update

* Refactor and improve docs for AccountModel and QuerySets

Refactored and enhanced documentation for AccountModel and its related query sets to ensure clarity and consistency. Introduced detailed attribute descriptions and method explanations while maintaining code functionality.

---------

Co-authored-by: Tom Hodder <[email protected]>
Co-authored-by: Eric paul <[email protected]>
Co-authored-by: Ubaid ur Rehman <[email protected]>
Co-authored-by: Krzysztof Czapla <[email protected]>

* Add logo and update documentation for Django Ledger CoA

This commit adds the Django Ledger logo to the Jupyter notebook and reworks the documentation for the Chart of Accounts (CoA) section. It also updates type imports, adjusts outputs, and includes explanations for handling multiple CoA and sample data population.

* Ui Icons Fix
Subscription ID on UI
Wallet Create Mutation
Sidebar Simplification

* Update to version 0.6.5 and add account lock/unlock methods

Bumped the project version to 0.6.5 and added Django 5.0 framework classifier. Enhanced AccountModel by introducing methods to lock and unlock accounts with validation. Simplified the get_queryset method for item views.

* Update to version 0.6.5 and add account lock/unlock methods

Bumped the project version to 0.6.5 and added Django 5.0 framework classifier. Enhanced AccountModel by introducing methods to lock and unlock accounts with validation. Simplified the get_queryset method for item views.

* Add `allow_empty` attribute and fix sales tax rate help text

Enable empty ledger list handling in LedgerModelListView by setting `allow_empty` to True. Additionally, update the help text for the sales tax rate field to correct the example conversion factor.

* Refactor queryset initialization in item views

Updated the get_queryset methods to use the AUTHORIZED_ENTITY_MODEL attribute for fetching related models instead of directly invoking model managers. This change improves code consistency and leverages the new entity model for querying related objects. Removed an outdated comment from the items.py model file.

* Add 'active' filter to queries and reorganize docstrings

Enhanced vendor and customer queries with an 'active' filter for better data accuracy. Also, standardized contribution docstrings across multiple files and updated the EstimateModel queryset to use the `AUTHORIZED_ENTITY_MODEL`.

* Update view mixins and clean up docstrings

Replaced security mixins with specific view mixins across multiple views to streamline authorization logic. Additionally, cleaned up and standardized docstrings in several modules.

* Rename model view mixins for better consistency

Replaced *ModelViewQuerySetMixIn class names with *ModelBaseView across multiple modules. This change improves naming clarity and consistency in the project's codebase.

* Add entity-based filtering and queryset improvements

Refactor multiple classes to enhance entity-based filtering and queryset handling. Streamline vendor and account queries, improve code readability, and consolidate security checks.

- Optimize AccountModel forms and remove unnecessary arguments
- Enhance AccountModel views to inherit from a base view and add select_related fields to view querysets, minimizing database queries during template rendering
- Implement AccountModel navigation URLs as model methods and annotate default AccountModel queryset with necessary relevant information
- Replace unique_together Meta option with constraints option on the AccountModel to conform with new API
- Add coa_slug as mandatory kwarg on all AccountModel-related views.

* Format code for readability and remove redundant methods

Reformatted various parts of the code for better readability by breaking long lines and ensuring consistent indentation. Additionally, removed redundant methods `with_roles` and `with_roles_available` from `models/accounts.py` to clean up unnecessary code.

* Simplify and format README.md for better readability

Condensed the README by removing verbose descriptions and reformatting key sections. Enhanced navigation with clear links to Discord, documentation, and the QuickStart Notebook, and streamlined the list of features for clarity.

* Update invoice detail URLs to include coa_slug parameter

Added the 'coa_slug' parameter to account-detail URLs in the invoice detail template to ensure proper linkage to the chart of accounts model. Updated the view to prefetch related coa_model fields for cash, prepaid, and unearned accounts.

* Reformat `with_roles` method calls for readability

Improve readability by reformatting `with_roles` method calls to use multiline styling consistently. This change enhances code maintainability without affecting functionality. It should make the nested roles easier to read and modify in the future.

* Refactor initialization logic in Bill forms

Replace individual entity and user model parameters with a single entity model parameter in BillModelCreateForm and BaseBillItemTransactionFormset. This simplifies querysets and improves code readability by leveraging direct relationships.

* Refactor bill views and forms with new base view

Refactored multiple components in `bill.py` to streamline and simplify the code by introducing `BillModelModelBaseView`. Replaced repeated logic for querying BillModel instances and standardized the creation and updating of forms.

* Add "Is Active" column to expense table and update account URLs

Added an "Is Active" column to the expense item table to indicate the status of expense items. Updated account detail URLs in bill detail template to include the chart of accounts slug for accurate link resolution.

* Account Model QuerySets optimization.

Update entity_slug to entity_model in various files

Replaces 'entity_slug' with 'entity_model' for better consistency and clarity across forms, views, and notebooks. This change also introduces the handling of ObjectDoesNotExist within notebooks and improves the use of queryset filtering.

* Refactor account tests and form ID handling

Added account management tests, including view protection and creation. Introduce form ID generation in account creation forms and implement utility methods for URL pattern resolution in tests.

* Add account activation and locking tests

Implemented tests for account activation and locking functionalities, including the ability to lock, unlock, activate, and deactivate accounts. Also updated the `get_coa_accounts` method to filter by locked status.

* Update `get_random_account` to filter by active and locked status

Add parameters to filter accounts based on their active and locked status. This enhances the function's flexibility and ensures more precise query results.

* Update execution timestamps in DjangoCon2024 notebook

Updated metadata execution timestamps throughout the DjangoCon2024 notebook to reflect the current date. Also added a note emphasizing a limitation in executing a particular code snippet within a Jupyter notebook.

* Add lock/unlock actions and COA active check in accounts

Introduced methods to generate lock/unlock URLs in the Account model, along with corresponding URL patterns. Added `is_coa_active` to check the COA active status, updating `can_activate` to utilize this check.

* Add lock status and actions to accounts table

Added a new column to display the lock status of each account and incorporated conditional icons to visually indicate if an account is locked or unlocked. Additionally, added actions in the dropdown menu to lock and unlock accounts based on the account's current state.

* Documentation Update

* Add new account model tests and refactor imports

Introduce tests for account annotations and transaction capabilities to ensure accurate entity associations and transaction status checks. Refactor import statements to remove unused `DEBIT` import and improve code readability with minor reformatting.

* Refactor AUTHORS.md for better organization

Reorganize sections in AUTHORS.md to separate Developers, Contributors, and Documentation Contributors for better clarity.

* Update README and contribution guidelines

Expanded the contact section in README for better clarity. Revised the Contribute.md file to include detailed guidelines, ensuring clarity on contribution processes and standards.

* v0.7.0

---------

Co-authored-by: Tom Hodder <[email protected]>
Co-authored-by: Eric paul <[email protected]>
Co-authored-by: Ubaid ur Rehman <[email protected]>
Co-authored-by: Krzysztof Czapla <[email protected]>
@elarroba elarroba self-assigned this Oct 25, 2024
@elarroba elarroba added bug Something isn't working enhancement New feature or request labels Oct 25, 2024
# Conflicts:
#	Pipfile
#	Pipfile.lock
#	django_ledger/__init__.py
#	django_ledger/forms/account.py
#	django_ledger/models/accounts.py
#	django_ledger/models/entity.py
#	notebooks/DjangoCon2024.ipynb
#	notebooks/QuickStart Notebook.ipynb
#	pyproject.toml
@elarroba elarroba merged commit 13543ac into master Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants