From cd57e009dd3023e419e7d9114ac32e5408b48881 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 17:01:53 +0530 Subject: [PATCH] fix: concurrency issue while picking materials (backport #43087) (#43152) fix: concurrency issue while picking materials (#43087) (cherry picked from commit 5c7dff0e846b3f28cd66a79ebec2d5cc18d68470) Co-authored-by: rohitwaghchaure --- erpnext/stock/doctype/pick_list/pick_list.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py index 0c93fd6c402..27a37ef1bab 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.py +++ b/erpnext/stock/doctype/pick_list/pick_list.py @@ -650,6 +650,8 @@ class PickList(Document): if self.name: query = query.where(pi_item.parent != self.name) + query = query.for_update() + return query.run(as_dict=True) def _get_product_bundles(self) -> dict[str, str]: