From 98d9d797fde4d0425a75290b76dd4ed52b31d968 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 16 Jun 2014 15:54:05 +0530 Subject: [PATCH] Tax category validation ignored in material request --- erpnext/controllers/buying_controller.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index accaeb4498..afccdfa0e3 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -52,9 +52,8 @@ class BuyingController(StockController): validate_warehouse_company(w, self.company) def validate_stock_or_nonstock_items(self): - if not self.get_stock_items(): - tax_for_valuation = [d.account_head for d in - self.get("other_charges") + if self.meta.get_field("other_charges") and not self.get_stock_items(): + tax_for_valuation = [d.account_head for d in self.get("other_charges") if d.category in ["Valuation", "Valuation and Total"]] if tax_for_valuation: frappe.throw(_("Tax Category can not be 'Valuation' or 'Valuation and Total' as all items are non-stock items"))