Skip to content

Commit

Permalink
fix: ignore repost logic on Payment Reconciliation
Browse files Browse the repository at this point in the history
  • Loading branch information
ruthra-kumar committed Sep 17, 2024
1 parent f47ea46 commit 75babd4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
5 changes: 5 additions & 0 deletions erpnext/accounts/doctype/journal_entry/journal_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ def on_submit(self):
self.update_booked_depreciation()

def on_update_after_submit(self):
# Flag will be set on Reconciliation
# Reconciliation tool will anyways repost ledger entries. So, no need to check and do implicit repost.
if self.flags.get("ignore_reposting_on_reconciliation"):
return

self.needs_repost = self.check_if_fields_updated(fields_to_check=[], child_tables={"accounts": []})
if self.needs_repost:
self.validate_for_repost()
Expand Down
2 changes: 2 additions & 0 deletions erpnext/accounts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,8 @@ def update_reference_in_journal_entry(d, journal_entry, do_not_save=False):

# will work as update after submit
journal_entry.flags.ignore_validate_update_after_submit = True
# Ledgers will be reposted by Reconciliation tool
journal_entry.flags.ignore_reposting_on_reconciliation = True
if not do_not_save:
journal_entry.save(ignore_permissions=True)

Expand Down
7 changes: 0 additions & 7 deletions erpnext/controllers/accounts_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -3570,13 +3570,6 @@ def check_if_child_table_updated(child_table_before_update, child_table_after_up

# Check if any field affecting accounting entry is altered
for index, item in enumerate(child_table_before_update):
if item.parenttype == "Journal Entry" and any(
[
child_table_after_update[index].get(i) != item.get(i)
for i in ["account", "party_type", "party", "debit", "credit"]
]
):
continue
for field in fields_to_check:
if child_table_after_update[index].get(field) != item.get(field):
return True
Expand Down

0 comments on commit 75babd4

Please sign in to comment.