Skip to content

Commit

Permalink
fix: if not budget then don't validate (backport #38861) (#38864)
Browse files Browse the repository at this point in the history
fix: if not budget then don't validate (#38861)

(cherry picked from commit d375164)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
  • Loading branch information
mergify[bot] and rohitwaghchaure authored Dec 19, 2023
1 parent 4057682 commit 793e3ad
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 793e3ad

Please sign in to comment.