mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-18 06:22:12 +00:00
fix: ignore repost logic on Payment Reconciliation
(cherry picked from commit 75babd4c18)
This commit is contained in:
@@ -195,6 +195,11 @@ class JournalEntry(AccountsController):
|
||||
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()
|
||||
|
||||
@@ -665,6 +665,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)
|
||||
|
||||
|
||||
@@ -3535,13 +3535,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
|
||||
|
||||
Reference in New Issue
Block a user