From bffd7feadb3480a3de7865193f4c0740cf592236 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Tue, 8 Mar 2022 21:35:10 +0530 Subject: [PATCH] fix: Remove docstatus check during budget validate --- erpnext/controllers/buying_controller.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index e5f35e1b72e..69adcbd87ba 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -530,17 +530,16 @@ class BuyingController(StockController, Subcontracting): self.update_fixed_asset(field, delete_asset=True) def validate_budget(self): - if self.docstatus == 1: - for data in self.get('items'): - args = data.as_dict() - args.update({ - 'doctype': self.doctype, - 'company': self.company, - 'posting_date': (self.schedule_date - if self.doctype == 'Material Request' else self.transaction_date) - }) + for data in self.get('items'): + args = data.as_dict() + args.update({ + 'doctype': self.doctype, + 'company': self.company, + 'posting_date': (self.schedule_date + if self.doctype == 'Material Request' else self.transaction_date) + }) - validate_expense_against_budget(args) + validate_expense_against_budget(args) def process_fixed_asset(self): if self.doctype == 'Purchase Invoice' and not self.update_stock: