[Fix] Not able to save purchase invoice, due to invalid condition (#14355)

This commit is contained in:
rohitwaghchaure 2018-06-05 13:08:10 +05:30 committed by Nabin Hait
parent 7c088ff623
commit 50d8c4a10f

View File

@ -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")