Merge pull request #39916 from rohitwaghchaure/fixed-pr-issue-9877
fix: not able to make purchase receipt
diff --git a/erpnext/controllers/subcontracting_controller.py b/erpnext/controllers/subcontracting_controller.py
index 17a2b07..eac35b0 100644
--- a/erpnext/controllers/subcontracting_controller.py
+++ b/erpnext/controllers/subcontracting_controller.py
@@ -539,6 +539,10 @@
def __add_supplied_item(self, item_row, bom_item, qty):
bom_item.conversion_factor = item_row.conversion_factor
rm_obj = self.append(self.raw_material_table, bom_item)
+ if rm_obj.get("qty"):
+ # Qty field not exists
+ rm_obj.qty = 0.0
+
rm_obj.reference_name = item_row.name
if self.doctype == self.subcontract_data.order_doctype: