From 79421bcfcc88686031d8876a2c4dcd327728f39c Mon Sep 17 00:00:00 2001 From: Dipen Gala Date: Thu, 18 Jun 2026 17:21:26 +0530 Subject: [PATCH] fix: set cost_center on RFQ item before submitting in test The test was mutating an already-submitted RFQ, which raised UpdateAfterSubmitError because cost_center lacks allow_on_submit. Use do_not_submit=True, set cost_center on the draft, save, then submit. Co-Authored-By: Claude Sonnet 4.6 --- .../request_for_quotation/test_request_for_quotation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py b/erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py index 95d24320dac..2e9a4970332 100644 --- a/erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py +++ b/erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py @@ -262,9 +262,10 @@ class TestRequestforQuotation(ERPNextTestSuite): self.assertEqual(rfq.items[0].cost_center, "_Test Cost Center - _TC") def test_cost_center_flows_from_rfq_to_supplier_quotation(self): - rfq = make_request_for_quotation() + rfq = make_request_for_quotation(do_not_submit=True) rfq.items[0].cost_center = "_Test Cost Center - _TC" rfq.save() + rfq.submit() sq = make_supplier_quotation_from_rfq(rfq.name, for_supplier=rfq.get("suppliers")[0].supplier)