diff --git a/erpnext/hub_node/__init__.py b/erpnext/hub_node/__init__.py
index ea1693d..df36552 100644
--- a/erpnext/hub_node/__init__.py
+++ b/erpnext/hub_node/__init__.py
@@ -34,22 +34,29 @@
 def get_categories():
 	# get categories info with parent category and stuff
 	connection = get_client_connection()
-	response = connection.get_list('Hub Category')
+	categories = connection.get_list('Hub Category')
+	print("============================================================")
+	print(categories)
+	response = [{'value': c.get('name'), 'expandable': c.get('is_group')} for c in categories]
 	return response
 
+	# return [
+	# 	{'value': 'Men', 'expandable': 1},
+	# 	{'value': 'Women', 'expandable': 0}
+	# ]
+
 @frappe.whitelist()
-def get_item_details(hub_sync_id=None):
+def get_details(hub_sync_id=None, doctype='Hub Item'):
 	if not hub_sync_id:
 		return
 	connection = get_client_connection()
-	item_details = connection.get_doc('Hub Item', hub_sync_id)
-	print(item_details)
-	return item_details
+	details = connection.get_doc(doctype, hub_sync_id)
+	return details
 
-@frappe.whitelist()
-def get_company_details(hub_sync_id):
-	connection = get_client_connection()
-	return connection.get_doc('Hub Company', hub_sync_id)
+# @frappe.whitelist()
+# def get_company_details(hub_sync_id):
+# 	connection = get_client_connection()
+# 	return connection.get_doc('Hub Company', hub_sync_id)
 
 def get_client_connection():
 	# frappeclient connection
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 69d8a47..45a5b11 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -484,7 +484,7 @@
 erpnext.patches.v10_0.update_asset_calculate_depreciation
 erpnext.patches.v10_0.add_guardian_role_for_parent_portal
 erpnext.patches.v10_0.set_numeric_ranges_in_template_if_blank
-erpnext.patches.v10_0.update_reserved_qty_for_purchase_order
+#erpnext.patches.v10_0.update_reserved_qty_for_purchase_order
 erpnext.patches.v10_0.fichier_des_ecritures_comptables_for_france
 erpnext.patches.v10_0.update_assessment_plan
 erpnext.patches.v10_0.update_assessment_result
@@ -493,4 +493,4 @@
 erpnext.patches.v10_0.set_default_payment_terms_based_on_company
 erpnext.patches.v10_0.update_sales_order_link_to_purchase_order
 erpnext.patches.v10_0.added_extra_gst_custom_field_in_gstr2
-erpnext.patches.v10_0.item_barcode_childtable_migrate
+#erpnext.patches.v10_0.item_barcode_childtable_migrate
diff --git a/erpnext/public/js/hub/hub_factory.js b/erpnext/public/js/hub/hub_factory.js
index 6789b80..0318c99 100644
--- a/erpnext/public/js/hub/hub_factory.js
+++ b/erpnext/public/js/hub/hub_factory.js
@@ -17,26 +17,19 @@
 		};
 
 		if (!erpnext.hub.pages[page_name]) {
-			if (page === 'Item' && !route[2]) {
+			if (!route[2]) {
+				// page === 'Item' &&
 				frappe.require(assets['List'], () => {
-					erpnext.hub.pages[page_name] = new erpnext.hub.ItemListing({
+					erpnext.hub.pages[page_name] = new erpnext.hub[page+'Listing']({
 						doctype: 'Hub Settings',
 						parent: this.make_page(true, page_name)
 					});
 					window.hub_page = erpnext.hub.pages[page_name];
 				});
-			} if (page === 'Company' && !route[2]) {
-				frappe.require(assets['List'], () => {
-					erpnext.hub.pages[page_name] = new erpnext.hub.CompanyListing({
-						doctype: 'Hub Settings',
-						parent: this.make_page(true, page_name)
-					});
-					window.hub_page = erpnext.hub.pages[page_name];
-				});
-			} else if(route[2]) {
+			} else {
 				frappe.require(assets['Form'], () => {
-					erpnext.hub.pages[page_name] = new erpnext.hub.HubForm({
-						hub_item_code: route[2],
+					erpnext.hub.pages[page_name] = new erpnext.hub[page+'Page']({
+						unique_id: route[2],
 						doctype: 'Hub Settings',
 						parent: this.make_page(true, page_name)
 					});
diff --git a/erpnext/public/js/hub/hub_form.js b/erpnext/public/js/hub/hub_form.js
index 208af41..eb7c6b4 100644
--- a/erpnext/public/js/hub/hub_form.js
+++ b/erpnext/public/js/hub/hub_form.js
@@ -3,22 +3,23 @@
 erpnext.hub.HubForm = class HubForm extends frappe.views.BaseList {
 	setup_defaults() {
 		super.setup_defaults();
-		this.page_title = this.data.item_name || this.hub_item_code || __('Hub Item');
-		this.method = 'erpnext.hub_node.get_item_details';
-	}
-
-	setup_fields() {
-		this.fields = ['hub_item_code', 'item_name', 'item_code', 'description', 'seller', 'company_name', 'country'];
+		this.method = 'erpnext.hub_node.get_details';
+		//doctype, unique_id,
 	}
 
 	set_breadcrumbs() {
+		this.set_title();
 		frappe.breadcrumbs.add({
 			label: __('Hub'),
-			route: '#Hub/Item',
+			route: '#Hub/' + this.doctype,
 			type: 'Custom'
 		});
 	}
 
+	set_title() {
+		this.page_title = this.data.item_name || this.hub_item_code || 'Hub' + this.doctype;
+	}
+
 	setup_side_bar() {
 		this.sidebar = new frappe.ui.Sidebar({
 			wrapper: this.$page.find('.layout-side-section'),
@@ -26,17 +27,14 @@
 		});
 	}
 
-	setup_filter_area() {
+	setup_filter_area() { }
 
-	}
-
-	setup_sort_selector() {
-
-	}
+	setup_sort_selector() { }
 
 	get_args() {
 		return {
-			hub_sync_id: this.hub_item_code
+			hub_sync_id: this.unique_id,
+			doctype: 'Hub ' + this.doctype
 		};
 	}
 
@@ -49,8 +47,13 @@
 	}
 
 	render() {
+		const image_html = this.data[this.image_field_name] ?
+			`<img src="${this.data[this.image_field_name]}">
+			<span class="helper"></span>` :
+			`<div class="standard-image">${frappe.get_abbr(this.page_title)}</div>`;
+
 		this.sidebar.add_item({
-			label: `<img src="${this.data.image}" />`
+			label: image_html
 		});
 
 		let fields = [];
@@ -73,7 +76,7 @@
 	}
 
 	toggle_result_area() {
-		this.$result.toggle(this.data.hub_item_code);
+		this.$result.toggle(this.unique_id);
 		this.$paging_area.toggle(this.data.length > 0);
 		this.$no_result.toggle(this.data.length == 0);
 
@@ -82,3 +85,57 @@
 			.toggle(show_more);
 	}
 };
+
+erpnext.hub.ItemPage = class ItemPage extends erpnext.hub.HubForm{
+	setup_defaults() {
+		super.setup_defaults();
+		this.doctype = 'Item';
+		this.image_field_name = 'image';
+	}
+
+	setup_fields() {
+		this.fields = ['hub_item_code', 'item_name', 'item_code', 'description',
+			'seller', 'company_name', 'country', 'hub_category'];
+	}
+
+	show_action_modal(item) {
+		return new Promise(res => {
+			let fields = [
+				{ label: __('Item Code'), fieldtype: 'Data', fieldname: 'item_code', default: item.item_code },
+				{ fieldtype: 'Column Break' },
+				{ label: __('Item Group'), fieldtype: 'Link', fieldname: 'item_group', default: item.item_group },
+				{ label: __('Supplier Details'), fieldtype: 'Section Break' },
+				{ label: __('Supplier Name'), fieldtype: 'Data', fieldname: 'supplier_name', default: item.company_name },
+				{ label: __('Supplier Email'), fieldtype: 'Data', fieldname: 'supplier_email', default: item.seller },
+				{ fieldtype: 'Column Break' },
+				{ label: __('Supplier Type'), fieldname: 'supplier_type',
+					fieldtype: 'Link', options: 'Supplier Type' }
+			];
+			fields = fields.map(f => { f.reqd = 1; return f; });
+
+			const d = new frappe.ui.Dialog({
+				title: __('Request for Quotation'),
+				fields: fields,
+				primary_action_label: __('Send'),
+				primary_action: (values) => {
+					res(values);
+					d.hide();
+				}
+			});
+
+			d.show();
+		});
+	}
+}
+
+erpnext.hub.CompanyPage = class CompanyPage extends erpnext.hub.HubForm{
+	setup_defaults() {
+		super.setup_defaults();
+		this.doctype = 'Company';
+		this.image_field_name = 'company_logo';
+	}
+
+	setup_fields() {
+		this.fields = ['company_name', 'description', 'route', 'country', 'seller', 'site_name'];
+	}
+}
diff --git a/erpnext/public/js/hub/hub_page.js b/erpnext/public/js/hub/hub_page.js
index 6e5ab98..2ca5eac 100644
--- a/erpnext/public/js/hub/hub_page.js
+++ b/erpnext/public/js/hub/hub_page.js
@@ -13,21 +13,26 @@
 	setup_fields() {
 		return this.get_meta()
 			.then(r => {
-				console.log('fields then', this.doctype);
+				// console.log('fields then', this.doctype);
 				this.meta = r.message || this.meta;
 				frappe.model.sync(this.meta);
 			});
 	}
 
 	get_meta() {
-		console.log('get_meta', this.doctype);
+		// console.log('get_meta', this.doctype);
 		return new Promise(resolve =>
 			frappe.call('erpnext.hub_node.get_meta', {doctype: this.doctype}, resolve));
 	}
 
 	set_breadcrumbs() { }
 
-	setup_side_bar() { }
+	setup_side_bar() {
+		this.sidebar = new frappe.ui.Sidebar({
+			wrapper: this.page.wrapper.find('.layout-side-section'),
+			css_class: 'hub-sidebar'
+		});
+	}
 
 	setup_sort_selector() { }
 
@@ -108,6 +113,26 @@
 		];
 	}
 
+	setup_side_bar() {
+		super.setup_side_bar();
+		this.category_tree = new frappe.ui.Tree({
+			parent: this.sidebar.$sidebar,
+			label: 'All Categories',
+			expandable: true,
+
+			args: {},
+			method: 'erpnext.hub_node.get_categories',
+			on_click: (node) => {
+				this.update_category(node.label);
+			}
+		});
+	}
+
+	update_category(label) {
+		this.current_category = (label=='All Categories') ? undefined : label;
+		this.refresh();
+	}
+
 	get_filters_for_args() {
 		let filters = {};
 		this.filter_area.get().forEach(f => {
@@ -139,7 +164,7 @@
 				<a href="${route}">
 					<div class="hub-item-image">
 						<div class="img-wrapper" style="height: 200px; width: 200px">
-							${image_html}
+							${ image_html }
 						</div>
 					</div>
 					<div class="hub-item-title">
@@ -158,7 +183,7 @@
 	setup_defaults() {
 		super.setup_defaults();
 		this.doctype = 'Hub Company';
-		this.fields = ['name', 'site_name', 'seller_city', 'seller_description', 'seller', 'country', 'company_name'];
+		this.fields = ['company_logo', 'name', 'site_name', 'seller_city', 'seller_description', 'seller', 'country', 'company_name'];
 		this.filters = [];
 		this.custom_filter_configs = [
 			{
@@ -186,33 +211,26 @@
 		return filters;
 	}
 
-	card_html(item) {
-		item._name = encodeURI(item.name);
-		const encoded_name = item._name;
-		const title = strip_html(item['item_name' || 'item_code']);
-		// console.log(item);
-		const company_name = item['company_name'];
+	card_html(company) {
+		company._name = encodeURI(company.name);
+		const route = `#Hub/Company/${company.company_name}`;
 
-		const route = `#Hub/Item/${item.hub_item_code}`;
-
-		const image_html = item.image ?
-			`<img src="${item.image}">
-			<span class="helper"></span>` :
-			`<div class="standard-image">${frappe.get_abbr(title)}</div>`;
+		let image_html = company.company_logo ?
+			`<img src="${company.company_logo}"><span class="helper"></span>` :
+			`<div class="standard-image">${frappe.get_abbr(company.company_name)}</div>`;
 
 		return `
 			<div class="hub-item-wrapper margin-bottom" style="width: 200px;">
 				<a href="${route}">
 					<div class="hub-item-image">
 						<div class="img-wrapper" style="height: 200px; width: 200px">
-							${image_html}
+							${ image_html }
 						</div>
 					</div>
 					<div class="hub-item-title">
 						<h5 class="bold">
-							${ title }
+							${ company.company_name }
 						</h5>
-						<p>${ company_name }</p>
 					</div>
 				</a>
 			</div>
