mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
Merge pull request #47941 from frappe/mergify/bp/version-15-hotfix/pr-47888
fix: do not remove item which has zero qty and zero valuation (backport #47888)
This commit is contained in:
@@ -163,8 +163,11 @@ class StockReconciliation(StockController):
|
|||||||
def set_current_serial_and_batch_bundle(self, voucher_detail_no=None, save=False) -> None:
|
def set_current_serial_and_batch_bundle(self, voucher_detail_no=None, save=False) -> None:
|
||||||
"""Set Serial and Batch Bundle for each item"""
|
"""Set Serial and Batch Bundle for each item"""
|
||||||
for item in self.items:
|
for item in self.items:
|
||||||
if not frappe.db.exists("Item", item.item_code):
|
if voucher_detail_no and voucher_detail_no != item.name:
|
||||||
frappe.throw(_("Item {0} does not exist").format(item.item_code))
|
continue
|
||||||
|
|
||||||
|
if not item.item_code:
|
||||||
|
continue
|
||||||
|
|
||||||
item_details = frappe.get_cached_value(
|
item_details = frappe.get_cached_value(
|
||||||
"Item", item.item_code, ["has_serial_no", "has_batch_no"], as_dict=1
|
"Item", item.item_code, ["has_serial_no", "has_batch_no"], as_dict=1
|
||||||
@@ -232,9 +235,6 @@ class StockReconciliation(StockController):
|
|||||||
if not save and item.use_serial_batch_fields:
|
if not save and item.use_serial_batch_fields:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if voucher_detail_no and voucher_detail_no != item.name:
|
|
||||||
continue
|
|
||||||
|
|
||||||
if not item.current_serial_and_batch_bundle:
|
if not item.current_serial_and_batch_bundle:
|
||||||
serial_and_batch_bundle = frappe.get_doc(
|
serial_and_batch_bundle = frappe.get_doc(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user