From 016585c2480b14b69656cfdfe807906e47d20ee7 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 26 Mar 2024 18:19:27 +0530 Subject: [PATCH] fix: validation error for the subcontracting receipt --- erpnext/stock/serial_batch_bundle.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/serial_batch_bundle.py b/erpnext/stock/serial_batch_bundle.py index 7b42103bdeb..9625b20da41 100644 --- a/erpnext/stock/serial_batch_bundle.py +++ b/erpnext/stock/serial_batch_bundle.py @@ -888,11 +888,11 @@ class SerialBatchCreation: return doc def validate_qty(self, doc): - if doc.type_of_transaction == "Outward": + if doc.type_of_transaction == "Outward" and self.actual_qty and doc.total_qty: precision = doc.precision("total_qty") - total_qty = abs(flt(doc.total_qty, precision)) - required_qty = abs(flt(self.actual_qty, precision)) + total_qty = flt(abs(doc.total_qty), precision) + required_qty = flt(abs(self.actual_qty), precision) if required_qty - total_qty > 0: msg = f"For the item {bold(doc.item_code)}, the Avaliable qty {bold(total_qty)} is less than the Required Qty {bold(required_qty)} in the warehouse {bold(doc.warehouse)}. Please add sufficient qty in the warehouse."