fix: perf issue while submitting stock entry (#39634)
diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
index dd68d16..65c08c1 100644
--- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
+++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
@@ -1675,9 +1675,10 @@
make_stock_entry(
purpose="Material Receipt",
item_code=item.name,
- qty=15,
+ qty=20,
company=company,
to_warehouse=from_warehouse,
+ posting_date=add_days(today(), -3),
)
# Step 3: Create Delivery Note with Internal Customer
@@ -1700,6 +1701,8 @@
from erpnext.stock.doctype.delivery_note.delivery_note import make_inter_company_purchase_receipt
pr = make_inter_company_purchase_receipt(dn.name)
+ pr.set_posting_time = 1
+ pr.posting_date = today()
pr.items[0].qty = 15
pr.items[0].from_warehouse = target_warehouse
pr.items[0].warehouse = to_warehouse
@@ -1718,6 +1721,7 @@
company=company,
from_warehouse=from_warehouse,
to_warehouse=target_warehouse,
+ posting_date=add_days(pr.posting_date, -1),
)
pr.reload()
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index c371b70..faccfa3 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -228,7 +228,6 @@
self.fg_completed_qty = 0.0
self.validate_serialized_batch()
- self.set_actual_qty()
self.calculate_rate_and_amount()
self.validate_putaway_capacity()