From 8554cbf001df9c332d4777ea6ba8f17c02c83360 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 20 Aug 2015 16:24:40 +0530 Subject: [PATCH 1/4] [minor] fixed patch item template attributes --- erpnext/patches/v5_7/item_template_attributes.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/patches/v5_7/item_template_attributes.py b/erpnext/patches/v5_7/item_template_attributes.py index 0bd1e08e16..e93bfe45a4 100644 --- a/erpnext/patches/v5_7/item_template_attributes.py +++ b/erpnext/patches/v5_7/item_template_attributes.py @@ -65,6 +65,12 @@ def migrate_item_variants(): item_attributes = frappe.db.sql("""select distinct item_attribute, item_attribute_value from `tabItem Variant` where parent=%s""", item.name) + if not item_attributes and not all_variants: + item = frappe.get_doc("Item", item.name) + item.has_variants = 0 + item.save() + continue + attribute_value_options = {} for attribute, value in item_attributes: attribute_value_options.setdefault(attribute, []).append(value) From 5c85740aab8205be5c31e1ba00bef8ab6e4dbe1e Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 20 Aug 2015 17:43:21 +0530 Subject: [PATCH 2/4] [minor] don't validate stock for template item --- erpnext/stock/doctype/item/item.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index cd3d295979..f9b41f1657 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -64,7 +64,7 @@ class Item(WebsiteGenerator): self.update_item_desc() self.synced_with_hub = 0 self.validate_has_variants() - self.validate_stock_for_template_must_be_zero() + # self.validate_stock_for_template_must_be_zero() self.validate_attributes() self.validate_variant_attributes() From db1a9edbdf61e30b57f735fd98010af8b7a09e4c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 20 Aug 2015 18:20:06 +0530 Subject: [PATCH 3/4] [minor] removed test case of template cannot have stock --- erpnext/stock/doctype/item/test_item.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py index 2ba96475bd..f7c0f40efa 100644 --- a/erpnext/stock/doctype/item/test_item.py +++ b/erpnext/stock/doctype/item/test_item.py @@ -46,11 +46,11 @@ class TestItem(unittest.TestCase): item = frappe.get_doc("Item", item_code) return item - def test_template_cannot_have_stock(self): - item = self.get_item(10) - make_stock_entry(item_code=item.name, target="Stores - _TC", qty=1, basic_rate=1) - item.has_variants = 1 - self.assertRaises(ItemTemplateCannotHaveStock, item.save) + # def test_template_cannot_have_stock(self): + # item = self.get_item(10) + # make_stock_entry(item_code=item.name, target="Stores - _TC", qty=1, basic_rate=1) + # item.has_variants = 1 + # self.assertRaises(ItemTemplateCannotHaveStock, item.save) def test_default_warehouse(self): item = frappe.copy_doc(test_records[0]) From e9cebd4de3b770dd8525dc853f7fe9515ae023b3 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 20 Aug 2015 19:17:19 +0600 Subject: [PATCH 4/4] bumped to version 5.7.5 --- erpnext/__version__.py | 2 +- erpnext/hooks.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/__version__.py b/erpnext/__version__.py index 33e3a7c6d9..0246af21a0 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = '5.7.4' +__version__ = '5.7.5' diff --git a/erpnext/hooks.py b/erpnext/hooks.py index a70cc72479..2a116ca3d6 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -27,7 +27,7 @@ blogs. """ app_icon = "icon-th" app_color = "#e74c3c" -app_version = "5.7.4" +app_version = "5.7.5" github_link = "https://github.com/frappe/erpnext" error_report_email = "support@erpnext.com" diff --git a/setup.py b/setup.py index a05d221131..9ef03d2eb7 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = "5.7.4" +version = "5.7.5" with open("requirements.txt", "r") as f: install_requires = f.readlines()