Merge pull request #55139 from frappe/mergify/bp/version-16-hotfix/pr-55134

fix: removed redundant code (backport #55134)
This commit is contained in:
rohitwaghchaure
2026-05-21 15:56:28 +05:30
committed by GitHub

View File

@@ -874,15 +874,6 @@ class update_entries_after:
if not self.args.get("sle_id"):
self.get_dynamic_incoming_outgoing_rate(sle)
if (
sle.voucher_type == "Stock Reconciliation"
and (sle.serial_and_batch_bundle)
and sle.voucher_detail_no
and not self.args.get("sle_id")
and sle.is_cancelled == 0
):
self.reset_actual_qty_for_stock_reco(sle)
if (
sle.voucher_type in ["Purchase Receipt", "Purchase Invoice"]
and sle.voucher_detail_no
@@ -1059,30 +1050,6 @@ class update_entries_after:
if not allow_zero_rate:
self.wh_data.valuation_rate = self.get_fallback_rate(sle)
def reset_actual_qty_for_stock_reco(self, sle):
doc = frappe.get_doc("Stock Reconciliation", sle.voucher_no)
if sle.actual_qty < 0:
doc.reload()
sle.actual_qty = (
flt(frappe.db.get_value("Stock Reconciliation Item", sle.voucher_detail_no, "current_qty"))
* -1
)
if abs(sle.actual_qty) == 0.0:
sle.is_cancelled = 1
if sle.serial_and_batch_bundle:
for row in doc.items:
if row.name == sle.voucher_detail_no:
row.db_set("current_serial_and_batch_bundle", "")
sabb_doc = frappe.get_doc("Serial and Batch Bundle", sle.serial_and_batch_bundle)
sabb_doc.voucher_detail_no = None
sabb_doc.voucher_no = None
sabb_doc.cancel()
def calculate_valuation_for_serial_batch_bundle(self, sle):
if not frappe.db.exists("Serial and Batch Bundle", sle.serial_and_batch_bundle):
return