diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 5a35e81e52f..0d5ffc16c83 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -633,9 +633,9 @@ class Item(WebsiteGenerator): def validate_stock_exists_for_template_item(self): if self.stock_ledger_created(): - if ((self._doc_before_save - and self._doc_before_save.has_variants != self.has_variants) - or self.variant_of != self._doc_before_save.variant_of): + if (self._doc_before_save + and (self._doc_before_save.has_variants != self.has_variants + or self._doc_before_save.variant_of != self.variant_of)): frappe.throw(_("Cannot change Variant properties after stock transction. You will have to make a new Item to do this.").format(self.name), StockExistsForTemplate)