feat: provide hook point for bulk transaction tasks

This commit is contained in:
Kitti U
2024-09-06 12:53:47 +07:00
parent 75cf3e245f
commit d4dd01d8d1

View File

@@ -146,6 +146,11 @@ def task(doc_name, from_doctype, to_doctype):
}, },
"Purchase Receipt": {"Purchase Invoice": purchase_receipt.make_purchase_invoice}, "Purchase Receipt": {"Purchase Invoice": purchase_receipt.make_purchase_invoice},
} }
hooks = frappe.get_hooks("bulk_transaction_task_mapper")
for hook in hooks:
mapper.update(frappe.get_attr(hook)())
frappe.flags.bulk_transaction = True frappe.flags.bulk_transaction = True
if to_doctype in ["Payment Entry"]: if to_doctype in ["Payment Entry"]:
obj = mapper[from_doctype][to_doctype](from_doctype, doc_name) obj = mapper[from_doctype][to_doctype](from_doctype, doc_name)