fix: performance issue related to stock entry by rohitwaghchaure [frappe] PR#39301 [backport/v4]
Backport of !1264 (merged)
Conflicts detected for source commit: 385de5000a965f5b683a3cdbf14e9d82345b8a4f
diff --cc erpnext/accounts/report/general_ledger/general_ledger.py
index 139d381172,6a3545dff1..0000000000
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@@ -276,6 -276,9 +276,12 @@@ def get_conditions(filters)
if filters.get("voucher_no"):
conditions.append("voucher_no=%(voucher_no)s")
++<<<<<<< HEAD
++=======
+ if filters.get("against_voucher_no"):
+ conditions.append("against_voucher=%(against_voucher_no)s")
+
++>>>>>>> 385de5000a965f5b683a3cdbf14e9d82345b8a4f
if filters.get("voucher_no_not_in"):
conditions.append("voucher_no not in %(voucher_no_not_in)s")
diff --cc erpnext/manufacturing/doctype/production_plan/production_plan.py
index f64af50188,5dc5c38376..0000000000
--- a/erpnext/manufacturing/doctype/production_plan/production_plan.py
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py
@@@ -599,7 -599,7 +599,11 @@@ class ProductionPlan(Document)
if close is not None:
self.db_set("status", self.status)
++<<<<<<< HEAD
+ if self.docstatus == 1 and self.status != "Completed":
++=======
+ if update_bin and self.docstatus == 1 and self.status != "Completed":
++>>>>>>> 385de5000a965f5b683a3cdbf14e9d82345b8a4f
self.update_bin_qty()
def update_ordered_status(self):
diff --cc erpnext/manufacturing/doctype/production_plan/test_production_plan.py
index fedeb7a477,1c748a809b..0000000000
--- a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py
+++ b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py
@@@ -1486,14 -1486,14 +1486,22 @@@ class TestProductionPlan(FrappeTestCase
before_qty = flt(frappe.db.get_value("Bin", bin_name, "reserved_qty_for_production_plan"))
pln.reload()
++<<<<<<< HEAD
+ pln.set_status(close=True)
++=======
+ pln.set_status(close=True, update_bin=True)
++>>>>>>> 385de5000a965f5b683a3cdbf14e9d82345b8a4f
bin_name = get_or_make_bin(rm_item, rm_warehouse)
after_qty = flt(frappe.db.get_value("Bin", bin_name, "reserved_qty_for_production_plan"))
self.assertAlmostEqual(after_qty, before_qty - 10)
pln.reload()
++<<<<<<< HEAD
+ pln.set_status(close=False)
++=======
+ pln.set_status(close=False, update_bin=True)
++>>>>>>> 385de5000a965f5b683a3cdbf14e9d82345b8a4f
bin_name = get_or_make_bin(rm_item, rm_warehouse)
after_qty = flt(frappe.db.get_value("Bin", bin_name, "reserved_qty_for_production_plan"))