From fe054508f12678236986ea3cf867b12c7f4bcde2 Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Wed, 14 Jun 2023 15:04:36 +0530 Subject: [PATCH] fix: 'NoneType' object has no attribute 'precision' for Job Card --- .../serial_and_batch_bundle.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 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 9a4206a03b..57bb71ef1e 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 @@ -124,6 +124,7 @@ class SerialandBatchBundle(Document): def set_incoming_rate(self, row=None, save=False): if self.type_of_transaction not in ["Inward", "Outward"] or self.voucher_type in [ "Installation Note", + "Job Card", "Maintenance Schedule", "Pick List", ]: @@ -569,6 +570,9 @@ class SerialandBatchBundle(Document): @property def child_table(self): + if self.voucher_type == "Job Card": + return + parent_child_map = { "Asset Capitalization": "Asset Capitalization Stock Item", "Asset Repair": "Asset Repair Consumed Item", @@ -576,11 +580,11 @@ class SerialandBatchBundle(Document): "Stock Entry": "Stock Entry Detail", } - table = f"{self.voucher_type} Item" - if self.voucher_type in parent_child_map: - table = parent_child_map[self.voucher_type] - - return table + return ( + parent_child_map[self.voucher_type] + if self.voucher_type in parent_child_map + else f"{self.voucher_type} Item" + ) def delink_refernce_from_voucher(self): or_filters = {"serial_and_batch_bundle": self.name}