fix: Exception naming
diff --git a/erpnext/accounts/doctype/accounting_dimension_filter/test_accounting_dimension_filter.py b/erpnext/accounts/doctype/accounting_dimension_filter/test_accounting_dimension_filter.py
index f67e1de..fa700e1 100644
--- a/erpnext/accounts/doctype/accounting_dimension_filter/test_accounting_dimension_filter.py
+++ b/erpnext/accounts/doctype/accounting_dimension_filter/test_accounting_dimension_filter.py
@@ -7,7 +7,7 @@
import unittest
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension import create_dimension, disable_dimension
-from erpnext.exceptions import InvalidAccountDimension, MandatoryDimension
+from erpnext.exceptions import InvalidAccountDimensionError, MandatoryAccountDimensionError
class TestAccountingDimensionFilter(unittest.TestCase):
def setUp(self):
@@ -20,7 +20,7 @@
si.location = 'Block 1'
si.save()
- self.assertRaises(InvalidAccountDimension, si.submit)
+ self.assertRaises(InvalidAccountDimensionError, si.submit)
def test_mandatory_dimension_validation(self):
si = create_sales_invoice(do_not_save=1)
@@ -31,7 +31,7 @@
si.items[0].cost_center = '_Test Cost Center 2 - _TC'
si.save()
- self.assertRaises(MandatoryDimension, si.submit)
+ self.assertRaises(MandatoryAccountDimensionError, si.submit)
def tearDown(self):
disable_dimension_filter()
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py
index f586de8..fd6f01e 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.py
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py
@@ -11,7 +11,7 @@
from erpnext.accounts.party import validate_party_gle_currency, validate_party_frozen_disabled
from erpnext.accounts.utils import get_account_currency
from erpnext.accounts.utils import get_fiscal_year
-from erpnext.exceptions import InvalidAccountCurrency, InvalidAccountDimension, MandatoryDimension
+from erpnext.exceptions import InvalidAccountCurrency, InvalidAccountDimensionError, MandatoryAccountDimensionError
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_checks_for_pl_and_bs_accounts
from erpnext.accounts.doctype.accounting_dimension_filter.accounting_dimension_filter import get_dimension_filter_map
from six import iteritems
@@ -101,16 +101,16 @@
if self.account == account:
if value['is_mandatory'] and not self.get(dimension):
frappe.throw(_("{0} is mandatory for account {1}").format(
- frappe.bold(frappe.unscrub(dimension)), frappe.bold(self.account)), MandatoryDimension)
+ frappe.bold(frappe.unscrub(dimension)), frappe.bold(self.account)), MandatoryAccountDimensionError)
if value['allow_or_restrict'] == 'Allow':
if self.get(dimension) and self.get(dimension) not in value['allowed_dimensions']:
frappe.throw(_("Invalid value {0} for account {1}").format(
- frappe.bold(self.get(dimension)), frappe.bold(self.account)), InvalidAccountDimension)
+ frappe.bold(self.get(dimension)), frappe.bold(self.account)), InvalidAccountDimensionError)
else:
if self.get(dimension) and self.get(dimension) in value['allowed_dimensions']:
frappe.throw(_("Invalid value {0} for account {1}").format(
- frappe.bold(self.get(dimension)), frappe.bold(self.account)), InvalidAccountDimension)
+ frappe.bold(self.get(dimension)), frappe.bold(self.account)), InvalidAccountDimensionError)
def check_pl_account(self):
if self.is_opening=='Yes' and \
diff --git a/erpnext/exceptions.py b/erpnext/exceptions.py
index dcf3d6b..04291cd 100644
--- a/erpnext/exceptions.py
+++ b/erpnext/exceptions.py
@@ -6,5 +6,5 @@
class InvalidAccountCurrency(frappe.ValidationError): pass
class InvalidCurrency(frappe.ValidationError): pass
class PartyDisabled(frappe.ValidationError):pass
-class InvalidAccountDimension(frappe.ValidationError): pass
-class MandatoryDimension(frappe.ValidationError): pass
+class InvalidAccountDimensionError(frappe.ValidationError): pass
+class MandatoryAccountDimensionError(frappe.ValidationError): pass