fix: 'NoneType' object has no attribute 'precision'
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 7aca791..9a4206a 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
@@ -122,7 +122,11 @@
frappe.throw(_(message), exception, title=_("Error"))
def set_incoming_rate(self, row=None, save=False):
- if self.type_of_transaction not in ["Inward", "Outward"]:
+ if self.type_of_transaction not in ["Inward", "Outward"] or self.voucher_type in [
+ "Installation Note",
+ "Maintenance Schedule",
+ "Pick List",
+ ]:
return
if self.type_of_transaction == "Outward":
@@ -220,7 +224,7 @@
def set_incoming_rate_for_inward_transaction(self, row=None, save=False):
valuation_field = "valuation_rate"
- if self.voucher_type in ["Sales Invoice", "Delivery Note"]:
+ if self.voucher_type in ["Sales Invoice", "Delivery Note", "Quotation"]:
valuation_field = "incoming_rate"
if self.voucher_type == "POS Invoice":
@@ -229,8 +233,10 @@
rate = row.get(valuation_field) if row else 0.0
child_table = self.child_table
- if self.voucher_type == "Subcontracting Receipt" and self.voucher_detail_no:
- if frappe.db.exists("Subcontracting Receipt Supplied Item", self.voucher_detail_no):
+ if self.voucher_type == "Subcontracting Receipt":
+ if not self.voucher_detail_no:
+ return
+ elif frappe.db.exists("Subcontracting Receipt Supplied Item", self.voucher_detail_no):
valuation_field = "rate"
child_table = "Subcontracting Receipt Supplied Item"
else: