fix: do not repost GL if no change in valuation

This commit is contained in:
Rohit Waghchaure
2026-04-04 12:47:43 +05:30
parent 2f9643d44d
commit 0063201818

View File

@@ -681,9 +681,6 @@ class update_entries_after:
self._sles = deque(self.sort_sles(self._sles))
def repost_stock_ledger_entry(self, sle):
if self.args.item_code != sle.item_code or self.args.warehouse != sle.warehouse:
self.repost_affected_transaction.add((sle.voucher_type, sle.voucher_no))
if isinstance(sle, dict):
sle = frappe._dict(sle)
@@ -945,6 +942,8 @@ class update_entries_after:
sle.stock_value = self.wh_data.stock_value
sle.stock_queue = json.dumps(self.wh_data.stock_queue)
old_stock_value_difference = sle.stock_value_difference
sle.stock_value_difference = stock_value_difference
if (
@@ -978,6 +977,14 @@ class update_entries_after:
):
self.update_outgoing_rate_on_transaction(sle)
if flt(old_stock_value_difference, self.currency_precision) == flt(
sle.stock_value_difference, self.currency_precision
):
return
if self.args.item_code != sle.item_code or self.args.warehouse != sle.warehouse:
self.repost_affected_transaction.add((sle.voucher_type, sle.voucher_no))
def get_serialized_values(self, sle):
from erpnext.stock.serial_batch_bundle import SerialNoValuation