feat: add accounting dimensions to create journal entry#365
Conversation
Confidence Score: 5/5Safe to merge — the dimension filtering is correctly allowlisted against live DB metadata, the caching logic is sound, and the awaited frappe.db.get_value response is accessed via the correct .message accessor. The core backend helper _get_valid_accounting_dimensions is well-isolated and tested with mocks; the JE integration test verifies the end-to-end path including both account rows. The reload_transactions refactor correctly preserves cached dimension state across sort changes. No data-corruption or security concerns were found. The test file is missing an integration test for the payment entry path — the new accounting_dimensions parameter in create_payment_entry_bts is only covered by the shared unit test of the helper function, not by a full PE creation flow.
|
There was a problem hiding this comment.
Tested, functionality works as expected. Some comments on consistency, style and performance.
- I think the "standard" Accounting Dimensions Project and Cost Center should also be visible for "Create Journal Entry" (they are already for "Create Payment Entry"). Then we can always show the collapsible section (maybe add it in Create Payment Entry" as well, for consistency?)
- The frontend calls
get_dimensionsfor each Bank Transaction. Calling it once when the reco tool is loaded should be enough. - I think adding short docstrings to the methods would help, at least where the content is long and not obvious from the name.
- I don't mind merging
allow_on_submitwith this PR, but if it had been a separate PR it would have been merged already. ;)
barredterra
left a comment
There was a problem hiding this comment.
Non-blocking design thought: should we hard-wire project and cost_center in the create form and reconciliation flow instead of loading them dynamically via accounting dimension metadata?
They are standard ERPNext fields and are already special-cased in the backend allowlist, while Payment Entry also has explicit project / cost_center parameters. A clearer split might be:
- render/pass
projectandcost_centerexplicitly - load dynamic accounting dimensions only for actual custom dimensions
- keep the backend allowlist as standard fields plus
get_accounting_dimensions(...) - keep applying dimensions to non-bank Journal Entry account rows, and to Payment Entry header fields
That would make the standard fields explicit and reduce coupling to the exact shape returned by get_dimensions(with_cost_center_and_project=True).
|
Let's wait for #379, then rebase on that. |
|
Delay port to v16 until #368 is merged |
Solves #362
Ref: LKP-76