From 724fd824192ce2c7ccbc4dec17efa14d846d6763 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Tue, 30 Jun 2015 12:52:39 +0530 Subject: [PATCH] Fixes in Manage Variants --- erpnext/patches/v5_0/item_variants.py | 3 ++- .../doctype/manage_variants/manage_variants.json | 12 ++++++++++-- .../__init__.py | 0 .../manage_variants_item.json} | 6 +++--- .../manage_variants_item.py} | 2 +- 5 files changed, 16 insertions(+), 7 deletions(-) rename erpnext/stock/doctype/{variant_item => manage_variants_item}/__init__.py (100%) rename erpnext/stock/doctype/{variant_item/variant_item.json => manage_variants_item/manage_variants_item.json} (93%) rename erpnext/stock/doctype/{variant_item/variant_item.py => manage_variants_item/manage_variants_item.py} (88%) diff --git a/erpnext/patches/v5_0/item_variants.py b/erpnext/patches/v5_0/item_variants.py index fd4e4bbe0c..6e4db19432 100644 --- a/erpnext/patches/v5_0/item_variants.py +++ b/erpnext/patches/v5_0/item_variants.py @@ -8,4 +8,5 @@ def execute(): manage_variant.attributes = frappe.db.sql("select item_attribute as attribute, item_attribute_value as attribute_value \ from `tabItem Variant` where parent = %s", d.name, as_dict=1) manage_variant.generate_combinations() - manage_variant.create_variants() \ No newline at end of file + manage_variant.create_variants() + frappe.delete_doc("doctype", "Item Variant") \ No newline at end of file diff --git a/erpnext/stock/doctype/manage_variants/manage_variants.json b/erpnext/stock/doctype/manage_variants/manage_variants.json index 1ad938d05b..055fc27442 100644 --- a/erpnext/stock/doctype/manage_variants/manage_variants.json +++ b/erpnext/stock/doctype/manage_variants/manage_variants.json @@ -17,6 +17,13 @@ "precision": "", "reqd": 1 }, + { + "fieldname": "section_break_2", + "fieldtype": "Section Break", + "label": "Item Variant Attributes", + "permlevel": 0, + "precision": "" + }, { "allow_on_submit": 0, "fieldname": "attributes", @@ -48,6 +55,7 @@ { "fieldname": "section_break_4", "fieldtype": "Section Break", + "label": "Item Variants", "permlevel": 0, "precision": "" }, @@ -55,7 +63,7 @@ "fieldname": "variants", "fieldtype": "Table", "label": "Variants", - "options": "Variant Item", + "options": "Manage Variants Item", "permlevel": 0, "precision": "" } @@ -67,7 +75,7 @@ "is_submittable": 0, "issingle": 1, "istable": 0, - "modified": "2015-05-28 06:18:03.238411", + "modified": "2015-06-30 03:18:13.787883", "modified_by": "Administrator", "module": "Stock", "name": "Manage Variants", diff --git a/erpnext/stock/doctype/variant_item/__init__.py b/erpnext/stock/doctype/manage_variants_item/__init__.py similarity index 100% rename from erpnext/stock/doctype/variant_item/__init__.py rename to erpnext/stock/doctype/manage_variants_item/__init__.py diff --git a/erpnext/stock/doctype/variant_item/variant_item.json b/erpnext/stock/doctype/manage_variants_item/manage_variants_item.json similarity index 93% rename from erpnext/stock/doctype/variant_item/variant_item.json rename to erpnext/stock/doctype/manage_variants_item/manage_variants_item.json index 13c46ac0f7..a8bb61d5e4 100644 --- a/erpnext/stock/doctype/variant_item/variant_item.json +++ b/erpnext/stock/doctype/manage_variants_item/manage_variants_item.json @@ -47,7 +47,7 @@ { "fieldname": "attributes", "fieldtype": "Text", - "hidden": 0, + "hidden": 1, "label": "attributes", "permlevel": 0, "precision": "", @@ -62,10 +62,10 @@ "is_submittable": 0, "issingle": 0, "istable": 1, - "modified": "2015-05-29 02:09:33.622631", + "modified": "2015-06-30 03:19:07.548196", "modified_by": "Administrator", "module": "Stock", - "name": "Variant Item", + "name": "Manage Variants Item", "name_case": "", "owner": "Administrator", "permissions": [], diff --git a/erpnext/stock/doctype/variant_item/variant_item.py b/erpnext/stock/doctype/manage_variants_item/manage_variants_item.py similarity index 88% rename from erpnext/stock/doctype/variant_item/variant_item.py rename to erpnext/stock/doctype/manage_variants_item/manage_variants_item.py index 4aa4ed81a4..800888a864 100644 --- a/erpnext/stock/doctype/variant_item/variant_item.py +++ b/erpnext/stock/doctype/manage_variants_item/manage_variants_item.py @@ -6,5 +6,5 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document -class VariantItem(Document): +class ManageVariantsItem(Document): pass