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 <noreply@anthropic.com>
This commit is contained in:
Dipen Gala
2026-06-18 17:21:26 +05:30
parent e91bcd6dd6
commit 79421bcfcc

View File

@@ -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)