fix: validate docs in closed accounting period on save (#36157)

fix: validate docs in closed accounting period on save (#36157)

(cherry picked from commit 5985e02574)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
This commit is contained in:
mergify[bot]
2023-07-18 17:40:49 +05:30
committed by GitHub
parent fbea61bbc6
commit b4db5e9561
6 changed files with 89 additions and 17 deletions

View File

@@ -822,6 +822,15 @@ def get_purchase_invoices(doctype, txt, searchfield, start, page_len, filters):
return frappe.db.sql(query, filters)
@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
def get_doctypes_for_closing(doctype, txt, searchfield, start, page_len, filters):
doctypes = frappe.get_hooks("period_closing_doctypes")
if txt:
doctypes = [d for d in doctypes if txt.lower() in d.lower()]
return [(d,) for d in set(doctypes)]
@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
def get_tax_template(doctype, txt, searchfield, start, page_len, filters):