From 88b02130e7008a2cacaf7a4b6bde7e2d2f2c0a10 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Mon, 27 Jul 2026 15:26:25 +0530 Subject: [PATCH] fix: recalculate whole bin for Production Plan raw material items projected_qty is derived from every bin quantity, so refreshing only reserved_qty_for_production_plan leaves it stale wherever another field had drifted. Call Bin.recalculate_values() instead. Renamed so the patch re-runs on sites that already applied recompute_production_plan_reserved_qty. --- erpnext/patches.txt | 2 +- ...ved_qty.py => recalculate_bins_for_production_plan_items.py} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename erpnext/patches/v16_0/{recompute_production_plan_reserved_qty.py => recalculate_bins_for_production_plan_items.py} (85%) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index be5b8202821..d14679f6844 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -501,5 +501,5 @@ erpnext.patches.v16_0.crm_settings_handle_allowed_users_for_frappe_crm erpnext.patches.v16_0.access_control_for_project_users erpnext.patches.v16_0.enable_book_stock_expense_gl_entries execute:frappe.db.set_single_value("Stock Settings", "use_inline_serial_batch_editor", 0) -erpnext.patches.v16_0.recompute_production_plan_reserved_qty +erpnext.patches.v16_0.recalculate_bins_for_production_plan_items erpnext.patches.v16_0.rename_ar_ap_ageing_filter diff --git a/erpnext/patches/v16_0/recompute_production_plan_reserved_qty.py b/erpnext/patches/v16_0/recalculate_bins_for_production_plan_items.py similarity index 85% rename from erpnext/patches/v16_0/recompute_production_plan_reserved_qty.py rename to erpnext/patches/v16_0/recalculate_bins_for_production_plan_items.py index c33d59eea8f..a3fe864e404 100644 --- a/erpnext/patches/v16_0/recompute_production_plan_reserved_qty.py +++ b/erpnext/patches/v16_0/recalculate_bins_for_production_plan_items.py @@ -20,4 +20,4 @@ def execute(): bin_name = frappe.db.get_value("Bin", {"item_code": item_code, "warehouse": warehouse}) if not bin_name: continue - frappe.get_doc("Bin", bin_name, for_update=True).update_reserved_qty_for_production_plan() + frappe.get_doc("Bin", bin_name, for_update=True).recalculate_values()