refactor: fetch correct hook variable

This commit is contained in:
ruthra kumar
2024-11-01 14:14:03 +05:30
parent ba09ddcc3a
commit 426010e21a
2 changed files with 4 additions and 9 deletions

View File

@@ -349,9 +349,8 @@ class AccountsController(TransactionBase):
adv = qb.DocType("Advance Payment Ledger Entry")
qb.from_(adv).delete().where(adv.voucher_type.eq(self.doctype) & adv.voucher_no.eq(self.name)).run()
advance_payment_doctypes = frappe.get_hooks("advance_payment_receivable_doctypes") + frappe.get_hooks(
"advance_payment_payable_doctypes"
)
advance_payment_doctypes = frappe.get_hooks("advance_payment_doctypes")
if self.doctype in advance_payment_doctypes:
qb.from_(adv).delete().where(
adv.against_voucher_type.eq(self.doctype) & adv.against_voucher_no.eq(self.name)
@@ -2562,9 +2561,7 @@ class AccountsController(TransactionBase):
repost_ledger.submit()
def get_advance_payment_doctypes(self) -> list:
return frappe.get_hooks("advance_payment_receivable_doctypes") + frappe.get_hooks(
"advance_payment_payable_doctypes"
)
return frappe.get_hooks("advance_payment_doctypes")
def make_advance_payment_ledger_for_journal(self):
advance_payment_doctypes = self.get_advance_payment_doctypes()

View File

@@ -4,9 +4,7 @@ from frappe.query_builder.custom import ConstantColumn
def get_advance_doctypes() -> list:
return frappe.get_hooks("advance_payment_receivable_doctypes") + frappe.get_hooks(
"advance_payment_payable_doctypes"
)
return frappe.get_hooks("advance_payment_doctypes")
def get_payments_with_so_po_reference() -> list: