From d9d4b9b1173d301afc0e7a8a59bed9d4119bbea0 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Mon, 2 Feb 2026 09:51:09 +0530 Subject: [PATCH 1/2] test: over ordering of quotation items (cherry picked from commit 53e58f66785920e8194ed3e0c221828e4e808293) --- erpnext/selling/doctype/quotation/test_quotation.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index e72b595f824..1086ce09ef5 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -885,6 +885,16 @@ class TestQuotation(FrappeTestCase): f"Expected conversion rate {expected_rate}, got {quotation.conversion_rate}", ) + def test_over_order_limit(self): + quotation = make_quotation(qty=5) + so1 = make_sales_order(quotation.name) + so2 = make_sales_order(quotation.name) + so1.delivery_date = nowdate() + so2.delivery_date = nowdate() + + so1.submit() + self.assertRaises(frappe.ValidationError, so2.submit) + test_records = frappe.get_test_records("Quotation") From 528a4822405989574797b6721ee06ddb06270c1b Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Mon, 2 Feb 2026 10:12:55 +0530 Subject: [PATCH 2/2] fix: imports --- erpnext/selling/doctype/quotation/test_quotation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index 1086ce09ef5..ae756f34288 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -886,6 +886,8 @@ class TestQuotation(FrappeTestCase): ) def test_over_order_limit(self): + from erpnext.selling.doctype.quotation.quotation import make_sales_order + quotation = make_quotation(qty=5) so1 = make_sales_order(quotation.name) so2 = make_sales_order(quotation.name)