feat: add accounting dimensions to create journal entry#365
Conversation
Confidence Score: 5/5Safe to merge. The accounting dimension helpers are well-guarded with an ERPNext allowlist, the JE bank-GL-skip is correct, and unit tests cover the key invariants. All core paths — Payment Entry dimension stamping, Journal Entry non-bank row stamping, and the frontend caching logic — look correct. The only finding is a localStorage key that is never written, which means the section expanded-state preference is not persisted across transaction switches, but this causes no data loss or reconciliation error. banking/public/js/bank_reconciliation_beta/actions_panel/create_tab.js — the localStorage persistence logic for the dimensions section state is incomplete.
|
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).
Solves #362 and #360
Ref: LKP-76