mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 13:24:47 +00:00
This commit is contained in:
@@ -11,7 +11,6 @@ from frappe.desk.reportview import build_match_conditions
|
||||
from erpnext.utilities.transaction_base import TransactionBase
|
||||
from frappe.geo.address_and_contact import load_address_and_contact, delete_contact_and_address
|
||||
from erpnext.accounts.party import validate_party_accounts, get_timeline_data # keep this
|
||||
from erpnext.accounts.party_status import get_party_status
|
||||
from erpnext import get_default_currency
|
||||
|
||||
class Customer(TransactionBase):
|
||||
@@ -70,7 +69,6 @@ class Customer(TransactionBase):
|
||||
self.flags.is_new_doc = self.is_new()
|
||||
self.flags.old_lead = self.lead_name
|
||||
validate_party_accounts(self)
|
||||
self.status = get_party_status(self)
|
||||
self.validate_credit_limit_on_change()
|
||||
|
||||
def on_update(self):
|
||||
|
||||
@@ -68,47 +68,6 @@ class TestQuotation(unittest.TestCase):
|
||||
self.assertEquals(quotation.get("items")[0].rate, total_margin)
|
||||
si.save()
|
||||
|
||||
def test_party_status_open(self):
|
||||
from erpnext.selling.doctype.customer.test_customer import get_customer_dict
|
||||
|
||||
customer = frappe.get_doc(get_customer_dict('Party Status Test')).insert()
|
||||
self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Active')
|
||||
|
||||
quotation = frappe.get_doc(get_quotation_dict(customer=customer.name)).insert()
|
||||
self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Open')
|
||||
|
||||
quotation.submit()
|
||||
self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Active')
|
||||
|
||||
quotation.cancel()
|
||||
quotation.delete()
|
||||
customer.delete()
|
||||
|
||||
def test_party_status_close(self):
|
||||
from erpnext.selling.doctype.customer.test_customer import get_customer_dict
|
||||
|
||||
customer = frappe.get_doc(get_customer_dict('Party Status Test')).insert()
|
||||
self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Active')
|
||||
|
||||
# open quotation
|
||||
quotation = frappe.get_doc(get_quotation_dict(customer=customer.name)).insert()
|
||||
self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Open')
|
||||
|
||||
# close quotation (submit)
|
||||
quotation.submit()
|
||||
|
||||
quotation1 = frappe.get_doc(get_quotation_dict(customer=customer.name)).insert()
|
||||
|
||||
# still open
|
||||
self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Open')
|
||||
|
||||
quotation.cancel()
|
||||
quotation.delete()
|
||||
|
||||
quotation1.delete()
|
||||
|
||||
customer.delete()
|
||||
|
||||
test_records = frappe.get_test_records('Quotation')
|
||||
|
||||
def get_quotation_dict(customer=None, item_code=None):
|
||||
|
||||
Reference in New Issue
Block a user