From 88e8688a4bfd3eb3f067454dec0949224ef666f9 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 10 Sep 2019 14:07:45 +0530 Subject: [PATCH] fix: set raw material's batch based on main item's batch only if RM has batch no (#18977) --- erpnext/controllers/buying_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index a7dc4c738e..084f84b1f9 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -337,7 +337,7 @@ class BuyingController(StockController): if self.doctype in ["Purchase Receipt", "Purchase Invoice"]: rm.consumed_qty = required_qty rm.description = bom_item.description - if item.batch_no and not rm.batch_no: + if item.batch_no and frappe.db.get_value("Item", rm.rm_item_code, "has_batch_no") and not rm.batch_no: rm.batch_no = item.batch_no # get raw materials rate