From 764b9bfeba4ce028b121fb1767f873fb168e30e0 Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Fri, 4 May 2018 17:58:36 +0530 Subject: [PATCH] cint for Item field has_variants (#13916) * convert none type value to int * Fix typo --- erpnext/stock/doctype/item/item.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 9b6397470e9..203458e4461 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -641,9 +641,9 @@ class Item(WebsiteGenerator): def validate_stock_exists_for_template_item(self): if self.stock_ledger_created() and self._doc_before_save: - if (self._doc_before_save.has_variants != self.has_variants + if (cint(self._doc_before_save.has_variants) != cint(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), + frappe.throw(_("Cannot change Variant properties after stock transaction. You will have to make a new Item to do this.").format(self.name), StockExistsForTemplate) if self.has_variants or self.variant_of: