diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 91ee53a796e..821185766eb 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -559,7 +559,7 @@ class BuyingController(SubcontractingController): { "incoming_rate": incoming_rate, "recalculate_rate": 1 - if (self.is_subcontracted and (d.bom or d.fg_item)) or d.from_warehouse + if (self.is_subcontracted and (d.bom or d.get("fg_item"))) or d.from_warehouse else 0, } )