fix: Add warning for invalid GST invoice numbers
GST Invoice numbers should be 16 characters alphanumeric with dash(/) or
slash(-) only. Add check for doc.name before saving and warn about
naming series.
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 59639ff..f87769c 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -278,6 +278,9 @@
('Sales Invoice', 'Sales Order', 'Delivery Note', 'Purchase Invoice', 'Purchase Order', 'Purchase Receipt'): {
'validate': ['erpnext.regional.india.utils.set_place_of_supply']
},
+ ('Sales Invoice', 'Purchase Invoice'): {
+ 'validate': ['erpnext.regional.india.utils.validate_document_name']
+ },
"Contact": {
"on_trash": "erpnext.support.doctype.issue.issue.update_issue",
"after_insert": "erpnext.telephony.doctype.call_log.call_log.link_existing_conversations",