mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-09 08:11:19 +00:00
fix: validation if e invoicing is disabled
This commit is contained in:
committed by
Deepesh Garg
parent
0ce26ce90d
commit
df09c76148
@@ -19,7 +19,8 @@ from frappe.utils.data import get_datetime, cstr, cint, format_date, flt
|
|||||||
from frappe.integrations.utils import make_post_request, make_get_request
|
from frappe.integrations.utils import make_post_request, make_get_request
|
||||||
|
|
||||||
def validate_einvoice_fields(doc):
|
def validate_einvoice_fields(doc):
|
||||||
if not doc.doctype in ['Sales Invoice', 'Purchase Invoice']: return
|
e_invoice_enabled = frappe.db.get_value("E Invoice Settings", "E Invoice Settings", "enable")
|
||||||
|
if not doc.doctype in ['Sales Invoice', 'Purchase Invoice'] or not e_invoice_enabled: return
|
||||||
|
|
||||||
if doc.docstatus == 1 and doc._action == 'submit' and not doc.irn:
|
if doc.docstatus == 1 and doc._action == 'submit' and not doc.irn:
|
||||||
frappe.throw(_("You must generate IRN before submitting the document."), title=_("Missing IRN"))
|
frappe.throw(_("You must generate IRN before submitting the document."), title=_("Missing IRN"))
|
||||||
|
|||||||
Reference in New Issue
Block a user