Skip to content

Commit

Permalink
fix: if not budget then don't validate (#38861)
Browse files Browse the repository at this point in the history
(cherry picked from commit d375164)
  • Loading branch information
rohitwaghchaure authored and mergify[bot] committed Dec 19, 2023
1 parent 5e68b7e commit 35de64c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion erpnext/stock/doctype/material_request/material_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ def set_title(self):
def on_submit(self):
self.update_requested_qty_in_production_plan()
self.update_requested_qty()
if self.material_request_type == "Purchase":
if self.material_request_type == "Purchase" and frappe.db.exists(
"Budget", {"applicable_on_material_request": 1, "docstatus": 1}
):
self.validate_budget()

def before_save(self):
Expand Down

0 comments on commit 35de64c

Please sign in to comment.