mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
fix: check if gst_category exist
This commit is contained in:
@@ -29,6 +29,7 @@ def validate_gstin_for_india(doc, method):
|
|||||||
|
|
||||||
gst_category = []
|
gst_category = []
|
||||||
|
|
||||||
|
if hasattr(doc, 'gst_category'):
|
||||||
if len(doc.links):
|
if len(doc.links):
|
||||||
link_doctype = doc.links[0].get("link_doctype")
|
link_doctype = doc.links[0].get("link_doctype")
|
||||||
link_name = doc.links[0].get("link_name")
|
link_name = doc.links[0].get("link_name")
|
||||||
@@ -76,6 +77,7 @@ def validate_tax_category(doc, method):
|
|||||||
frappe.throw(_("Intra State tax category for GST State {0} already exists").format(doc.gst_state))
|
frappe.throw(_("Intra State tax category for GST State {0} already exists").format(doc.gst_state))
|
||||||
|
|
||||||
def update_gst_category(doc, method):
|
def update_gst_category(doc, method):
|
||||||
|
if hasattr(doc, 'gst_category'):
|
||||||
for link in doc.links:
|
for link in doc.links:
|
||||||
if link.link_doctype in ['Customer', 'Supplier']:
|
if link.link_doctype in ['Customer', 'Supplier']:
|
||||||
if doc.get('gstin'):
|
if doc.get('gstin'):
|
||||||
|
|||||||
Reference in New Issue
Block a user