From 5c760175d199a0e579073440d316773c4f0f4377 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 16 Mar 2020 17:26:02 +0530 Subject: [PATCH] fix: deletion of auto-created batch (#20953) --- erpnext/controllers/stock_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index d13edc34573..c6d0c7c0a6e 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -239,7 +239,7 @@ class StockController(AccountsController): for d in self.items: if not d.batch_no: continue - serial_nos = [d.name for d in frappe.get_all("Serial No", {'batch_no': d.batch_no})] + serial_nos = [sr.name for sr in frappe.get_all("Serial No", {'batch_no': d.batch_no})] if serial_nos: frappe.db.set_value("Serial No", { 'name': ['in', serial_nos] }, "batch_no", None)