migrate from manufacturer to manufacturer childtable
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 0e34ee6..3c2a372 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -379,3 +379,5 @@
erpnext.patches.v7_2.move_dates_from_salary_structure_to_employee
erpnext.patches.v7_2.make_all_assessment_group
erpnext.patches.v7_2.stock_uom_in_selling
+
+erpnext.patches.v8_0.manufacturer_childtable_migrate
diff --git a/erpnext/patches/v8_0/__init__.py b/erpnext/patches/v8_0/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/patches/v8_0/__init__.py
diff --git a/erpnext/patches/v8_0/manufacturer_childtable_migrate.py b/erpnext/patches/v8_0/manufacturer_childtable_migrate.py
new file mode 100644
index 0000000..6bb7880
--- /dev/null
+++ b/erpnext/patches/v8_0/manufacturer_childtable_migrate.py
@@ -0,0 +1,17 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ item_manufacturers = frappe.get_all("Item", fields=["name", "manufacturer", "manufacturer_part_no"])
+ for item in item_manufacturers:
+ item_doc = frappe.get_doc("Item", item.name)
+ item_doc.append("manufacturers", {
+ "manufacturer": item.manufacturer,
+ "manufacturer_part_no": item.manufacturer_part_no
+ })
+ item_doc.flags.ignore_validate = True
+ item_doc.flags.ignore_mandatory = True
+ item_doc.save()
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index db327cc..eb37864 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -1533,6 +1533,65 @@
"bold": 0,
"collapsible": 1,
"columns": 0,
+ "fieldname": "manufacturer_details",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Manufacturer Details",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "manufacturers",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Item Manufacturers",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item Manufacturer",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
"depends_on": "",
"fieldname": "supplier_details",
"fieldtype": "Section Break",
@@ -1623,65 +1682,6 @@
"collapsible": 0,
"columns": 0,
"depends_on": "",
- "fieldname": "manufacturer",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Manufacturer",
- "length": 0,
- "no_copy": 0,
- "options": "Manufacturer",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "fieldname": "manufacturer_part_no",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Manufacturer Part Number",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
"fieldname": "column_break2",
"fieldtype": "Column Break",
"hidden": 0,
@@ -2837,8 +2837,8 @@
"issingle": 0,
"istable": 0,
"max_attachments": 1,
- "modified": "2017-03-21 21:03:10.715674",
- "modified_by": "Administrator",
+ "modified": "2017-03-24 14:07:02.172008",
+ "modified_by": "d.ottenbreit@eso-electronic.de",
"module": "Stock",
"name": "Item",
"owner": "Administrator",