Patch for Item Variants

This commit is contained in:
Neil Trini Lasrado 2015-06-29 15:06:46 +05:30
parent c761fefb78
commit 3f2604eff6
3 changed files with 13 additions and 2 deletions

View File

@ -168,4 +168,4 @@ execute:frappe.delete_doc("Page", "users")
erpnext.patches.v5_0.update_material_transferred_for_manufacturing_again
erpnext.patches.v5_0.index_on_account_and_gl_entry
execute:frappe.db.sql("""delete from `tabProject Task`""")
erpnext.patches.v5_0.item_variants

View File

@ -0,0 +1,11 @@
import frappe
def execute():
frappe.reload_doctype("Item")
for d in frappe.get_list("Item", filters={"has_variants":1}):
manage_variant = frappe.new_doc("Manage Variants")
manage_variant.item = d.name
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()

View File

@ -902,7 +902,7 @@
"icon": "icon-tag",
"idx": 1,
"max_attachments": 1,
"modified": "2015-06-26 17:20:18.204558",
"modified": "2015-06-29 17:20:18.204558",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",