feat: add pre-submit credit limit warning on save

This commit is contained in:
Jatin3128
2026-04-22 03:33:10 +05:30
parent ffae7e42d3
commit 26d3a25d18
5 changed files with 350 additions and 2 deletions

View File

@@ -340,6 +340,14 @@ period_closing_doctypes = [
"Subcontracting Receipt",
]
pre_submit_validation_doctypes = [
"Sales Invoice",
"Purchase Invoice",
"Delivery Note",
"Purchase Receipt",
"Sales Order",
]
doc_events = {
"*": {
"validate": [
@@ -350,6 +358,9 @@ doc_events = {
tuple(period_closing_doctypes): {
"validate": "erpnext.accounts.doctype.accounting_period.accounting_period.validate_accounting_period_on_doc_save",
},
tuple(pre_submit_validation_doctypes): {
"validate": "erpnext.accounts.utils.pre_submit_validation",
},
"Stock Entry": {
"on_submit": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty",
"on_cancel": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty",