From 7b878ea3d8f2a1da6c8bd9d4994e638c630e59ba Mon Sep 17 00:00:00 2001 From: Sagar Sharma Date: Tue, 13 Sep 2022 21:52:58 +0530 Subject: [PATCH] fix: unknown column error while updating value of maintain-stock in item master --- erpnext/stock/doctype/item/item.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 87fa72d74f..143fe408c3 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -945,7 +945,12 @@ class Item(Document): if doctype == "Product Bundle": filters = {"new_item_code": self.name} - if doctype in ( + if linked_doc := frappe.db.get_value( + doctype, filters, ["new_item_code as docname"], as_dict=True + ): + return linked_doc.update({"doctype": doctype}) + + elif doctype in ( "Purchase Invoice Item", "Sales Invoice Item", ):