From c6acb0d2006455a8181e1e1844a2b172288cea4d Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Sun, 11 Jun 2023 22:04:08 +0530 Subject: [PATCH] fix: DocType not found --- .../serial_and_batch_bundle.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py index cc55bd6ea8..7aca791fe1 100644 --- a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py +++ b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py @@ -563,9 +563,16 @@ class SerialandBatchBundle(Document): @property def child_table(self): + parent_child_map = { + "Asset Capitalization": "Asset Capitalization Stock Item", + "Asset Repair": "Asset Repair Consumed Item", + "Quotation": "Packed Item", + "Stock Entry": "Stock Entry Detail", + } + table = f"{self.voucher_type} Item" - if self.voucher_type == "Stock Entry": - table = f"{self.voucher_type} Detail" + if self.voucher_type in parent_child_map: + table = parent_child_map[self.voucher_type] return table