Merge pull request #24186 from frappe/validate_regional_germany
fix: regional validation of sales invoice (germany)
This commit is contained in:
commit
5e15a5d230
@ -48,9 +48,6 @@ def validate_regional(doc):
|
||||
|
||||
def missing(field_label, regulation):
|
||||
"""Notify the user that a required field is missing."""
|
||||
context = 'Specific for Germany. Example: Remember to set Company Tax ID. It is required by § 14 Abs. 4 Nr. 2 UStG.'
|
||||
msgprint(_('Remember to set {field_label}. It is required by {regulation}.', context=context).format(
|
||||
field_label=frappe.bold(_(field_label)),
|
||||
regulation=regulation
|
||||
)
|
||||
)
|
||||
translated_msg = _('Remember to set {field_label}. It is required by {regulation}.', context='Specific for Germany. Example: Remember to set Company Tax ID. It is required by § 14 Abs. 4 Nr. 2 UStG.') # noqa: E501
|
||||
formatted_msg = translated_msg.format(field_label=frappe.bold(_(field_label)), regulation=regulation)
|
||||
msgprint(formatted_msg)
|
||||
|
12
erpnext/regional/germany/test_accounts_controller.py
Normal file
12
erpnext/regional/germany/test_accounts_controller.py
Normal file
@ -0,0 +1,12 @@
|
||||
import frappe
|
||||
import unittest
|
||||
from erpnext.regional.germany.accounts_controller import validate_regional
|
||||
|
||||
|
||||
class TestAccountsController(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.sales_invoice = frappe.get_last_doc('Sales Invoice')
|
||||
|
||||
def test_validate_regional(self):
|
||||
validate_regional(self.sales_invoice)
|
Loading…
x
Reference in New Issue
Block a user