diff --git a/erpnext/shopping_cart/test_shopping_cart.py b/erpnext/shopping_cart/test_shopping_cart.py index 17fc73e3a1..a8308b2a95 100644 --- a/erpnext/shopping_cart/test_shopping_cart.py +++ b/erpnext/shopping_cart/test_shopping_cart.py @@ -197,8 +197,7 @@ class TestShoppingCart(unittest.TestCase): def remove_all_items_from_cart(self): quotation = _get_cart_quotation() - quotation.set("items", []) - quotation.save(ignore_permissions=True) + quotation.delete() def create_user_if_not_exists(self, email, first_name = None): if frappe.db.exists("User", email): diff --git a/erpnext/utilities/doctype/contact/contact.py b/erpnext/utilities/doctype/contact/contact.py index ae2fdfb6f8..312b0b1df5 100644 --- a/erpnext/utilities/doctype/contact/contact.py +++ b/erpnext/utilities/doctype/contact/contact.py @@ -98,7 +98,7 @@ def update_contact(doc, method): contact_name = frappe.db.get_value("Contact", {"email_id": doc.name}) if contact_name: contact = frappe.get_doc("Contact", contact_name) - contact.first_name = doc.first_name - contact.last_name = doc.last_name - contact.phone = doc.phone + for key in ("first_name", "last_name", "phone"): + if doc.get(key): + contact.set(key, doc.get(key)) contact.save(ignore_permissions=True)