diff --git a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py index da6c2eefae4..bec4a8391e3 100644 --- a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py @@ -2043,6 +2043,7 @@ def create_customer(name="_Test Customer 2 USD", currency="USD"): customer.customer_name = name customer.default_currency = currency customer.type = "Individual" + customer.customer_group = "Individual" customer.save() customer = customer.name return customer diff --git a/erpnext/accounts/doctype/payment_ledger_entry/test_payment_ledger_entry.py b/erpnext/accounts/doctype/payment_ledger_entry/test_payment_ledger_entry.py index 9a33a7ccf6d..dd3a936f220 100644 --- a/erpnext/accounts/doctype/payment_ledger_entry/test_payment_ledger_entry.py +++ b/erpnext/accounts/doctype/payment_ledger_entry/test_payment_ledger_entry.py @@ -80,6 +80,7 @@ class TestPaymentLedgerEntry(FrappeTestCase): customer = frappe.new_doc("Customer") customer.customer_name = name customer.type = "Individual" + customer.customer_group = "Individual" customer.save() self.customer = customer.name diff --git a/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py index 59c385855fa..b7d8fb44853 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py +++ b/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py @@ -2546,6 +2546,7 @@ def make_customer(customer_name, currency=None): customer = frappe.new_doc("Customer") customer.customer_name = customer_name customer.type = "Individual" + customer.customer_group = "Individual" if currency: customer.default_currency = currency diff --git a/erpnext/accounts/doctype/subscription/test_subscription.py b/erpnext/accounts/doctype/subscription/test_subscription.py index 1d906fb9276..aba51ac5c6a 100644 --- a/erpnext/accounts/doctype/subscription/test_subscription.py +++ b/erpnext/accounts/doctype/subscription/test_subscription.py @@ -629,18 +629,21 @@ def create_parties(): customer.customer_name = "_Test Subscription Customer" customer.default_currency = "USD" customer.append("accounts", {"company": "_Test Company", "account": "_Test Receivable USD - _TC"}) + customer.customer_group = "Individual" customer.insert() if not frappe.db.exists("Customer", "_Test Subscription Customer Multi Currency"): customer = frappe.new_doc("Customer") customer.customer_name = "Test Subscription Customer Multi Currency" customer.default_currency = "USD" + customer.customer_group = "Individual" customer.insert() if not frappe.db.exists("Customer", "_Test Subscription Customer John Doe"): customer = frappe.new_doc("Customer") customer.customer_name = "_Test Subscription Customer John Doe" customer.append("accounts", {"company": "_Test Company", "account": "_Test Receivable - _TC"}) + customer.customer_group = "Individual" customer.insert() diff --git a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py index 4dfcd3bf259..88a3b818196 100644 --- a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py @@ -779,6 +779,7 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase): "customer_name": "Jane Doe", "type": "Individual", "default_currency": "USD", + "customer_group": "Individual", } ) .insert() @@ -1002,6 +1003,7 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase): "customer_name": "Jane Doe", "type": "Individual", "default_currency": "USD", + "customer_group": "Individual", } ) .insert() diff --git a/erpnext/accounts/report/gross_profit/test_gross_profit.py b/erpnext/accounts/report/gross_profit/test_gross_profit.py index 35f24df015f..9a0a9cc5174 100644 --- a/erpnext/accounts/report/gross_profit/test_gross_profit.py +++ b/erpnext/accounts/report/gross_profit/test_gross_profit.py @@ -82,6 +82,7 @@ class TestGrossProfit(FrappeTestCase): customer = frappe.new_doc("Customer") customer.customer_name = name customer.type = "Individual" + customer.customer_group = "Individual" customer.save() self.customer = customer.name diff --git a/erpnext/accounts/test/accounts_mixin.py b/erpnext/accounts/test/accounts_mixin.py index 3cad657553e..2bce9b46835 100644 --- a/erpnext/accounts/test/accounts_mixin.py +++ b/erpnext/accounts/test/accounts_mixin.py @@ -12,6 +12,7 @@ class AccountsTestMixin: customer = frappe.new_doc("Customer") customer.customer_name = customer_name customer.type = "Individual" + customer.customer_group = "Individual" if currency: customer.default_currency = currency @@ -36,6 +37,7 @@ class AccountsTestMixin: "account": default_account, }, ) + customer.customer_group = "Individual" customer.save() self.customer = customer_name diff --git a/erpnext/accounts/test_party.py b/erpnext/accounts/test_party.py index 9d3de5e8282..8b4a52603bf 100644 --- a/erpnext/accounts/test_party.py +++ b/erpnext/accounts/test_party.py @@ -7,12 +7,8 @@ from erpnext.accounts.party import get_default_price_list class PartyTestCase(FrappeTestCase): def test_get_default_price_list_should_return_none_for_invalid_group(self): customer = frappe.get_doc( - { - "doctype": "Customer", - "customer_name": "test customer", - } + {"doctype": "Customer", "customer_name": "test customer", "customer_group": "Individual"} ).insert(ignore_permissions=True, ignore_mandatory=True) - customer.customer_group = None customer.save() price_list = get_default_price_list(customer) assert price_list is None diff --git a/erpnext/controllers/tests/test_accounts_controller.py b/erpnext/controllers/tests/test_accounts_controller.py index a120da6f852..3ecf3d8b0af 100644 --- a/erpnext/controllers/tests/test_accounts_controller.py +++ b/erpnext/controllers/tests/test_accounts_controller.py @@ -29,6 +29,7 @@ def make_customer(customer_name, currency=None): customer = frappe.new_doc("Customer") customer.customer_name = customer_name customer.customer_type = "Individual" + customer.customer_group = "Individual" if currency: customer.default_currency = currency diff --git a/erpnext/crm/doctype/lead/lead.py b/erpnext/crm/doctype/lead/lead.py index f0f492191fb..db909534cdf 100644 --- a/erpnext/crm/doctype/lead/lead.py +++ b/erpnext/crm/doctype/lead/lead.py @@ -324,7 +324,7 @@ def _make_customer(source_name, target_doc=None, ignore_permissions=False): target.customer_name = source.lead_name if not target.customer_group: - target.customer_group = frappe.db.get_default("Customer Group") + target.customer_group = "Individual" doclist = get_mapped_doc( "Lead", diff --git a/erpnext/crm/report/sales_pipeline_analytics/test_sales_pipeline_analytics.py b/erpnext/crm/report/sales_pipeline_analytics/test_sales_pipeline_analytics.py index bf3f946d6ab..7622c38f94c 100644 --- a/erpnext/crm/report/sales_pipeline_analytics/test_sales_pipeline_analytics.py +++ b/erpnext/crm/report/sales_pipeline_analytics/test_sales_pipeline_analytics.py @@ -196,6 +196,7 @@ def create_customer(): if not doc: doc = frappe.new_doc("Customer") doc.customer_name = "_Test NC" + doc.customer_group = "Individual" doc.insert() diff --git a/erpnext/regional/report/uae_vat_201/test_uae_vat_201.py b/erpnext/regional/report/uae_vat_201/test_uae_vat_201.py index cab84024417..8c2b559fe52 100644 --- a/erpnext/regional/report/uae_vat_201/test_uae_vat_201.py +++ b/erpnext/regional/report/uae_vat_201/test_uae_vat_201.py @@ -148,6 +148,7 @@ def make_customer(): "doctype": "Customer", "customer_name": "_Test UAE Customer", "customer_type": "Company", + "customer_group": "Individual", } ) customer.insert() diff --git a/erpnext/regional/report/vat_audit_report/test_vat_audit_report.py b/erpnext/regional/report/vat_audit_report/test_vat_audit_report.py index a898a251043..26b2969e2c5 100644 --- a/erpnext/regional/report/vat_audit_report/test_vat_audit_report.py +++ b/erpnext/regional/report/vat_audit_report/test_vat_audit_report.py @@ -115,6 +115,7 @@ def make_customer(): "doctype": "Customer", "customer_name": "_Test SA Customer", "customer_type": "Company", + "customer_group": "Individual", } ).insert() diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py index dfb4a5b4445..a8fd5ed76ca 100644 --- a/erpnext/selling/doctype/customer/test_customer.py +++ b/erpnext/selling/doctype/customer/test_customer.py @@ -450,6 +450,7 @@ def make_customer(customer_name): customer = frappe.new_doc("Customer") customer.customer_name = customer_name customer.customer_type = "Individual" + customer.customer_group = "Individual" customer.insert() return customer.name else: