From 237a871f17787b6a8842a3f3ac1e3efb3072d89a Mon Sep 17 00:00:00 2001 From: "FinByz Tech Pvt. Ltd" Date: Tue, 22 Jan 2019 20:49:06 +0530 Subject: [PATCH] fix: NoneType object has no attribute "gstin" (#16458) * fix: NoneType object has no attribute "gstin" * fix: handle NoneType values --- erpnext/regional/india/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py index fd0eb34abc..d7a025805c 100644 --- a/erpnext/regional/india/utils.py +++ b/erpnext/regional/india/utils.py @@ -5,7 +5,7 @@ from erpnext.regional.india import states, state_numbers from erpnext.controllers.taxes_and_totals import get_itemised_tax, get_itemised_taxable_amount def validate_gstin_for_india(doc, method): - if not hasattr(doc, 'gstin'): + if not hasattr(doc, 'gstin') or not doc.gstin: return doc.gstin = doc.gstin.upper().strip()