fix: ignore repost logic on Payment Reconciliation

(cherry picked from commit 75babd4c18)
This commit is contained in:
ruthra kumar
2024-09-17 14:38:26 +05:30
committed by Mergify
parent 310b131469
commit d91013a467
3 changed files with 7 additions and 7 deletions

View File

@@ -195,6 +195,11 @@ class JournalEntry(AccountsController):
self.update_booked_depreciation() self.update_booked_depreciation()
def on_update_after_submit(self): 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": []}) self.needs_repost = self.check_if_fields_updated(fields_to_check=[], child_tables={"accounts": []})
if self.needs_repost: if self.needs_repost:
self.validate_for_repost() self.validate_for_repost()

View File

@@ -665,6 +665,8 @@ def update_reference_in_journal_entry(d, journal_entry, do_not_save=False):
# will work as update after submit # will work as update after submit
journal_entry.flags.ignore_validate_update_after_submit = True 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: if not do_not_save:
journal_entry.save(ignore_permissions=True) journal_entry.save(ignore_permissions=True)

View File

@@ -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 # Check if any field affecting accounting entry is altered
for index, item in enumerate(child_table_before_update): 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: for field in fields_to_check:
if child_table_after_update[index].get(field) != item.get(field): if child_table_after_update[index].get(field) != item.get(field):
return True return True