fix: 'NoneType' object has no attribute 'precision' for Job Card

This commit is contained in:
s-aga-r 2023-06-14 15:04:36 +05:30
parent c9923e4996
commit fe054508f1

View File

@ -124,6 +124,7 @@ class SerialandBatchBundle(Document):
def set_incoming_rate(self, row=None, save=False): def set_incoming_rate(self, row=None, save=False):
if self.type_of_transaction not in ["Inward", "Outward"] or self.voucher_type in [ if self.type_of_transaction not in ["Inward", "Outward"] or self.voucher_type in [
"Installation Note", "Installation Note",
"Job Card",
"Maintenance Schedule", "Maintenance Schedule",
"Pick List", "Pick List",
]: ]:
@ -569,6 +570,9 @@ class SerialandBatchBundle(Document):
@property @property
def child_table(self): def child_table(self):
if self.voucher_type == "Job Card":
return
parent_child_map = { parent_child_map = {
"Asset Capitalization": "Asset Capitalization Stock Item", "Asset Capitalization": "Asset Capitalization Stock Item",
"Asset Repair": "Asset Repair Consumed Item", "Asset Repair": "Asset Repair Consumed Item",
@ -576,11 +580,11 @@ class SerialandBatchBundle(Document):
"Stock Entry": "Stock Entry Detail", "Stock Entry": "Stock Entry Detail",
} }
table = f"{self.voucher_type} Item" return (
if self.voucher_type in parent_child_map: parent_child_map[self.voucher_type]
table = parent_child_map[self.voucher_type] if self.voucher_type in parent_child_map
else f"{self.voucher_type} Item"
return table )
def delink_refernce_from_voucher(self): def delink_refernce_from_voucher(self):
or_filters = {"serial_and_batch_bundle": self.name} or_filters = {"serial_and_batch_bundle": self.name}