diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 91ee53a796e3..821185766ebf 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -559,7 +559,7 @@ def update_stock_ledger(self, allow_negative_stock=False, via_landed_cost_vouche { "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, } )