refactor: repost without checking on flag

(cherry picked from commit 09f429ffba)
This commit is contained in:
ruthra kumar
2024-07-18 15:34:59 +05:30
committed by Mergify
parent a243873ab0
commit 0284328e2c

View File

@@ -2376,16 +2376,12 @@ class AccountsController(TransactionBase):
@frappe.whitelist()
def repost_accounting_entries(self):
if self.repost_required:
repost_ledger = frappe.new_doc("Repost Accounting Ledger")
repost_ledger.company = self.company
repost_ledger.append("vouchers", {"voucher_type": self.doctype, "voucher_no": self.name})
repost_ledger.flags.ignore_permissions = True
repost_ledger.insert()
repost_ledger.submit()
self.db_set("repost_required", 0)
else:
frappe.throw(_("No updates pending for reposting"))
@frappe.whitelist()