fix: add flags for repost to ensure correct accounting from India Compliance App

This commit is contained in:
Smit Vora 2024-02-27 20:28:18 +05:30
parent 07fd93a6f6
commit 7d14ecfcb8
2 changed files with 3 additions and 0 deletions

View File

@ -88,6 +88,7 @@ class RepostAccountingLedger(Document):
).append(gle.update({"old": True}))
def generate_preview_data(self):
frappe.flags.through_repost_accounting_ledger = True
self.gl_entries = []
self.get_existing_ledger_entries()
for x in self.vouchers:
@ -141,6 +142,7 @@ class RepostAccountingLedger(Document):
@frappe.whitelist()
def start_repost(account_repost_doc=str) -> None:
frappe.flags.through_repost_accounting_ledger = True
if account_repost_doc:
repost_doc = frappe.get_doc("Repost Accounting Ledger", account_repost_doc)

View File

@ -272,6 +272,7 @@ def on_doctype_update():
def repost(doc):
try:
frappe.flags.through_repost_item_valuation = True
if not frappe.db.exists("Repost Item Valuation", doc.name):
return