From a2bf53ff0aea3debc69ef696351c4ce2a5dfdb17 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 1 Oct 2025 18:25:11 +0530 Subject: [PATCH] fix: too many writes on patch run (cherry picked from commit 44ff6ed6a14f6757f9e3e910173a72d152acdecf) --- .../patch_missing_buying_price_list_in_material_request.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/patches/v15_0/patch_missing_buying_price_list_in_material_request.py b/erpnext/patches/v15_0/patch_missing_buying_price_list_in_material_request.py index 48f85335dd2..369be8469d5 100644 --- a/erpnext/patches/v15_0/patch_missing_buying_price_list_in_material_request.py +++ b/erpnext/patches/v15_0/patch_missing_buying_price_list_in_material_request.py @@ -9,5 +9,8 @@ def execute(): docs = frappe.get_all( "Material Request", filters={"buying_price_list": ["is", "not set"], "docstatus": 1}, pluck="name" ) + old_limit = frappe.db.MAX_WRITES_PER_TRANSACTION + frappe.db.MAX_WRITES_PER_TRANSACTION *= 4 for doc in docs: frappe.db.set_value("Material Request", doc, "buying_price_list", default_buying_price_list) + frappe.db.MAX_WRITES_PER_TRANSACTION = old_limit