fix: check if gst_category exist

(cherry picked from commit 59c31bb124)
This commit is contained in:
Anuja Pawar
2021-10-22 19:26:31 +05:30
committed by mergify-bot
parent 117718d410
commit 97544e2bbc

View File

@@ -30,6 +30,7 @@ def validate_gstin_for_india(doc, method):
gst_category = []
if hasattr(doc, 'gst_category'):
if len(doc.links):
link_doctype = doc.links[0].get("link_doctype")
link_name = doc.links[0].get("link_name")
@@ -66,6 +67,7 @@ def validate_tax_category(doc, method):
frappe.throw(_("Intra State tax category for GST State {0} already exists").format(doc.gst_state))
def update_gst_category(doc, method):
if hasattr(doc, 'gst_category'):
for link in doc.links:
if link.link_doctype in ['Customer', 'Supplier']:
if doc.get('gstin'):