diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 92b7fee774b..a06f0420df5 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -51,7 +51,8 @@ class Quotation(SellingController): frappe.throw(_("Valid till date cannot be before transaction date")) def validate_shopping_cart_items(self): - if self.order_type != "Shopping Cart": return + if self.order_type != "Shopping Cart": + return for item in self.items: if not frappe.db.exists("Website Item", {"item_code": item.item_code}): diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index 33d2a813730..d00ee7ad4bc 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -131,8 +131,6 @@ class TestQuotation(FrappeTestCase): self.assertRaises(frappe.ValidationError, make_sales_order, quotation.name) def test_shopping_cart_without_website_item(self): - from erpnext.selling.doctype.quotation.quotation import make_sales_order - if frappe.db.exists('Website Item', {'item_code': '_Test Item Home Desktop 100'}): frappe.get_last_doc('Website Item', {'item_code': '_Test Item Home Desktop 100'}).delete()