From c313f05a8ea8503faac3f70cb9e163e60933f1ed Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Mon, 2 Nov 2020 19:52:42 +0530 Subject: [PATCH] chore: improve document name validation message --- erpnext/regional/india/e_invoice/utils.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/erpnext/regional/india/e_invoice/utils.py b/erpnext/regional/india/e_invoice/utils.py index 34139e5db7d..a5d58e62781 100644 --- a/erpnext/regional/india/e_invoice/utils.py +++ b/erpnext/regional/india/e_invoice/utils.py @@ -32,11 +32,13 @@ def validate_einvoice_fields(doc): frappe.throw(_('You cannot edit the invoice after generating IRN'), title=_('Edit Not Allowed')) if len(doc.name) > 16: title = _('Document Name Too Long') - msg = (_('As you have E-Invoicing enabled, To be able to generate IRN for this invoice, document name {} exceed 16 letters. ') - .format(bold(_('should not')))) + msg = _('As you have E-Invoicing enabled, To be able to generate IRN for this invoice, ') + msg += _('document name {} exceed 16 letters. ').format(bold(_('should not'))) msg += '

' - msg += (_('You {} modify your {} in order to have document name of {} length of 16. ') - .format(bold(_('must')), bold(_('naming series')), bold(_('maximum')))) + msg += _('You must {} your {} in order to have document name of {} length 16. ').format( + bold(_('modify')), bold(_('naming series')), bold(_('maximum')) + ) + msg += _('Please account for ammended document names too. ') frappe.throw(msg, title=title) elif doc.docstatus == 1 and doc._action == 'submit' and not doc.irn: