[hub][patch] reset publish_in_hub for all items
diff --git a/erpnext/hub_node/data_migration_mapping/item_to_hub_item/item_to_hub_item.json b/erpnext/hub_node/data_migration_mapping/item_to_hub_item/item_to_hub_item.json
index 7423f2e..55bda48 100644
--- a/erpnext/hub_node/data_migration_mapping/item_to_hub_item/item_to_hub_item.json
+++ b/erpnext/hub_node/data_migration_mapping/item_to_hub_item/item_to_hub_item.json
@@ -1,55 +1,55 @@
 {
- "condition": "{\"publish_in_hub\": 1}",
- "creation": "2017-09-07 13:27:52.726350",
- "docstatus": 0,
- "doctype": "Data Migration Mapping",
+ "condition": "{\"publish_in_hub\": 1}", 
+ "creation": "2017-09-07 13:27:52.726350", 
+ "docstatus": 0, 
+ "doctype": "Data Migration Mapping", 
  "fields": [
   {
-   "is_child_table": 0,
-   "local_fieldname": "item_code",
+   "is_child_table": 0, 
+   "local_fieldname": "item_code", 
    "remote_fieldname": "item_code"
-  },
+  }, 
   {
-   "is_child_table": 0,
-   "local_fieldname": "item_name",
+   "is_child_table": 0, 
+   "local_fieldname": "item_name", 
    "remote_fieldname": "item_name"
-  },
+  }, 
   {
-   "is_child_table": 0,
-   "local_fieldname": "eval:frappe.db.get_default(\"company\")",
+   "is_child_table": 0, 
+   "local_fieldname": "eval:frappe.db.get_default(\"company\")", 
    "remote_fieldname": "company_name"
-  },
+  }, 
   {
-   "is_child_table": 0,
-   "local_fieldname": "image",
+   "is_child_table": 0, 
+   "local_fieldname": "image", 
    "remote_fieldname": "image"
-  },
+  }, 
   {
-   "is_child_table": 0,
-   "local_fieldname": "item_group",
+   "is_child_table": 0, 
+   "local_fieldname": "item_group", 
    "remote_fieldname": "item_group"
-  },
+  }, 
   {
-   "is_child_table": 0,
-   "local_fieldname": "eval:frappe.session.user",
+   "is_child_table": 0, 
+   "local_fieldname": "eval:frappe.session.user", 
    "remote_fieldname": "seller"
-  },
+  }, 
   {
-   "is_child_table": 0,
-   "local_fieldname": "eval:frappe.db.get_default(\"country\")",
+   "is_child_table": 0, 
+   "local_fieldname": "eval:frappe.db.get_default(\"country\")", 
    "remote_fieldname": "country"
   }
- ],
- "idx": 1,
- "local_doctype": "Item",
- "mapping_name": "Item to Hub Item",
- "mapping_type": "Push",
- "migration_id_field": "hub_sync_id",
- "modified": "2018-02-14 15:57:05.595712",
- "modified_by": "achilles@erpnext.com",
- "name": "Item to Hub Item",
- "owner": "Administrator",
- "page_length": 10,
- "remote_objectname": "Hub Item",
+ ], 
+ "idx": 1, 
+ "local_doctype": "Item", 
+ "mapping_name": "Item to Hub Item", 
+ "mapping_type": "Push", 
+ "migration_id_field": "hub_sync_id", 
+ "modified": "2018-07-27 21:52:52.383842", 
+ "modified_by": "cave@aperture.com", 
+ "name": "Item to Hub Item", 
+ "owner": "Administrator", 
+ "page_length": 10, 
+ "remote_objectname": "Hub Item", 
  "remote_primary_key": "item_code"
 }
\ No newline at end of file
diff --git a/erpnext/hub_node/data_migration_plan/hub_sync/hub_sync.json b/erpnext/hub_node/data_migration_plan/hub_sync/hub_sync.json
index d66ac24..c07623a 100644
--- a/erpnext/hub_node/data_migration_plan/hub_sync/hub_sync.json
+++ b/erpnext/hub_node/data_migration_plan/hub_sync/hub_sync.json
@@ -1,22 +1,18 @@
 {
- "creation": "2017-09-07 11:39:38.445902",
- "docstatus": 0,
- "doctype": "Data Migration Plan",
- "idx": 1,
+ "creation": "2017-09-07 11:39:38.445902", 
+ "docstatus": 0, 
+ "doctype": "Data Migration Plan", 
+ "idx": 1, 
  "mappings": [
   {
-   "enabled": 1,
+   "enabled": 1, 
    "mapping": "Item to Hub Item"
-  },
-  {
-   "enabled": 1,
-   "mapping": "Hub Message to Lead"
   }
- ],
- "modified": "2018-02-14 15:57:05.519715",
- "modified_by": "achilles@erpnext.com",
- "module": "Hub Node",
- "name": "Hub Sync",
- "owner": "Administrator",
+ ], 
+ "modified": "2018-07-27 21:52:52.324025", 
+ "modified_by": "cave@aperture.com", 
+ "module": "Hub Node", 
+ "name": "Hub Sync", 
+ "owner": "Administrator", 
  "plan_name": "Hub Sync"
 }
\ No newline at end of file
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index c5d8e0f..154f440 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -560,3 +560,4 @@
 erpnext.patches.v11_0.add_item_group_defaults
 erpnext.patches.v10_0.update_address_template_for_india
 execute:frappe.delete_doc("Page", "hub")
+erpnext.patches.v11_0.reset_publish_in_hub_for_all_items
diff --git a/erpnext/patches/v11_0/reset_publish_in_hub_for_all_items.py b/erpnext/patches/v11_0/reset_publish_in_hub_for_all_items.py
new file mode 100644
index 0000000..fac772c
--- /dev/null
+++ b/erpnext/patches/v11_0/reset_publish_in_hub_for_all_items.py
@@ -0,0 +1,5 @@
+import frappe
+
+def execute():
+	frappe.reload_doc('stock', 'doctype', 'item')
+	frappe.db.sql("""update `tabItem` set publish_in_hub = 0""")