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
  • Loading branch information
rohitwaghchaure authored Dec 19, 2023
1 parent 7fdac62 commit d375164
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 @@ -123,7 +123,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 d375164

Please sign in to comment.