diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index b0d1e348b9..48b82bde40 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -460,7 +460,7 @@ class BuyingController(StockController): def validate_items(self): # validate items to see if they have is_purchase_item or is_subcontracted_item enabled - if self.is_subcontracted: + if hasattr(self, "is_subcontracted") and self.is_subcontracted == 'Yes': validate_item_type(self, "is_sub_contracted_item", "subcontracted") else: validate_item_type(self, "is_purchase_item", "purchase")