refactor: make reposting implicit

(cherry picked from commit 722ef92324)

# Conflicts:
#	erpnext/accounts/doctype/journal_entry/journal_entry.py
This commit is contained in:
ruthra kumar
2024-07-12 10:04:54 +05:30
committed by Mergify
parent ccc2a47e73
commit 4668a2d7d8
3 changed files with 16 additions and 0 deletions

View File

@@ -99,6 +99,20 @@ class JournalEntry(AccountsController):
self.update_asset_value()
self.update_inter_company_jv()
self.update_invoice_discounting()
<<<<<<< HEAD
=======
self.update_booked_depreciation()
def on_update_after_submit(self):
if hasattr(self, "repost_required"):
self.needs_repost = self.check_if_fields_updated(
fields_to_check=[], child_tables={"accounts": []}
)
if self.needs_repost:
self.validate_for_repost()
self.db_set("repost_required", self.needs_repost)
self.repost_accounting_entries()
>>>>>>> 722ef92324 (refactor: make reposting implicit)
def on_cancel(self):
# References for this Journal are removed on the `on_cancel` event in accounts_controller

View File

@@ -601,6 +601,7 @@ class PurchaseInvoice(BuyingController):
if self.needs_repost:
self.validate_for_repost()
self.db_set("repost_required", self.needs_repost)
self.repost_accounting_entries()
def make_gl_entries(self, gl_entries=None, from_repost=False):
update_outstanding = "No" if (cint(self.is_paid) or self.write_off_account) else "Yes"

View File

@@ -549,6 +549,7 @@ class SalesInvoice(SellingController):
if self.needs_repost:
self.validate_for_repost()
self.db_set("repost_required", self.needs_repost)
self.repost_accounting_entries()
def set_paid_amount(self):
paid_amount = 0.0