[Minor]Changed CustomerDisabled and CustomerFrozen to PartyDisabled and PartyFrozen
This commit is contained in:
parent
323dc96c99
commit
f76853a8d9
@ -10,7 +10,7 @@ from frappe.defaults import get_user_permissions
|
||||
from frappe.utils import add_days, getdate, formatdate, get_first_day, date_diff
|
||||
from erpnext.utilities.doctype.address.address import get_address_display
|
||||
from erpnext.utilities.doctype.contact.contact import get_contact_details
|
||||
from erpnext.exceptions import CustomerFrozen, InvalidCurrency, CustomerDisabled, InvalidAccountCurrency
|
||||
from erpnext.exceptions import PartyFrozen, InvalidCurrency, PartyDisabled, InvalidAccountCurrency
|
||||
|
||||
class DuplicatePartyAccountError(frappe.ValidationError): pass
|
||||
|
||||
@ -314,7 +314,7 @@ def validate_party_frozen_disabled(party, party_type):
|
||||
frozen_accounts_modifier = frappe.db.get_value( 'Accounts Settings', None,'frozen_accounts_modifier')
|
||||
if not frozen_accounts_modifier in frappe.get_roles():
|
||||
if frappe.db.get_value(party_type, party, "is_frozen"):
|
||||
frappe.throw("{0} {1} is frozen".format(party_type, party), CustomerFrozen)
|
||||
frappe.throw("{0} {1} is frozen".format(party_type, party), PartyFrozen)
|
||||
|
||||
if frappe.db.get_value(party_type, party, "disabled"):
|
||||
frappe.throw("{0} {1} is disabled".format(party_type, party), CustomerDisabled)
|
||||
frappe.throw("{0} {1} is disabled".format(party_type, party), PartyDisabled)
|
||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
||||
|
||||
import frappe, unittest
|
||||
from erpnext.accounts.party import get_due_date
|
||||
from erpnext.exceptions import CustomerFrozen, CustomerDisabled
|
||||
from erpnext.exceptions import PartyFrozen, PartyDisabled
|
||||
from frappe.test_runner import make_test_records
|
||||
|
||||
test_records = frappe.get_test_records('Supplier')
|
||||
@ -65,7 +65,7 @@ class TestSupplier(unittest.TestCase):
|
||||
|
||||
po = create_purchase_order(do_not_save=True)
|
||||
|
||||
self.assertRaises(CustomerDisabled, po.save)
|
||||
self.assertRaises(PartyDisabled, po.save)
|
||||
|
||||
frappe.db.set_value("Supplier", "_Test Supplier", "disabled", 0)
|
||||
|
||||
|
@ -11,7 +11,7 @@ from erpnext.utilities.transaction_base import TransactionBase
|
||||
from erpnext.controllers.recurring_document import convert_to_recurring, validate_recurring_document
|
||||
from erpnext.controllers.sales_and_purchase_return import validate_return
|
||||
from erpnext.accounts.party import get_party_account_currency, validate_party_frozen_disabled
|
||||
from erpnext.exceptions import CustomerFrozen, InvalidCurrency, CustomerDisabled
|
||||
from erpnext.exceptions import InvalidCurrency
|
||||
|
||||
force_item_fields = ("item_group", "barcode", "brand", "stock_uom")
|
||||
|
||||
|
@ -2,7 +2,7 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
# accounts
|
||||
class CustomerFrozen(frappe.ValidationError): pass
|
||||
class PartyFrozen(frappe.ValidationError): pass
|
||||
class InvalidAccountCurrency(frappe.ValidationError): pass
|
||||
class InvalidCurrency(frappe.ValidationError): pass
|
||||
class CustomerDisabled(frappe.ValidationError):pass
|
||||
class PartyDisabled(frappe.ValidationError):pass
|
||||
|
@ -7,7 +7,7 @@ import frappe
|
||||
import unittest
|
||||
|
||||
from frappe.test_runner import make_test_records
|
||||
from erpnext.exceptions import CustomerFrozen, CustomerDisabled
|
||||
from erpnext.exceptions import PartyFrozen, PartyDisabled
|
||||
|
||||
test_ignore = ["Price List"]
|
||||
|
||||
@ -76,7 +76,7 @@ class TestCustomer(unittest.TestCase):
|
||||
|
||||
so = make_sales_order(do_not_save= True)
|
||||
|
||||
self.assertRaises(CustomerFrozen, so.save)
|
||||
self.assertRaises(PartyFrozen, so.save)
|
||||
|
||||
frappe.db.set_value("Customer", "_Test Customer", "is_frozen", 0)
|
||||
|
||||
@ -91,7 +91,7 @@ class TestCustomer(unittest.TestCase):
|
||||
|
||||
so = make_sales_order(do_not_save=True)
|
||||
|
||||
self.assertRaises(CustomerDisabled, so.save)
|
||||
self.assertRaises(PartyDisabled, so.save)
|
||||
|
||||
frappe.db.set_value("Customer", "_Test Customer", "disabled", 0)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user