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.
This commit is contained in:
Mihir Kandoi
2026-07-27 15:26:25 +05:30
parent 8b37c52187
commit 88b02130e7
2 changed files with 2 additions and 2 deletions

View File

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

View File

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