added manifest, hooks and fixed requires webnotes/wnframework#351
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..7bf6b4d
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,18 @@
+include MANIFEST.in
+include requirements.txt
+include *.json
+include *.md
+include *.py
+include *.txt
+recursive-include erpnext *.css
+recursive-include erpnext *.csv
+recursive-include erpnext *.html
+recursive-include erpnext *.ico
+recursive-include erpnext *.js
+recursive-include erpnext *.json
+recursive-include erpnext *.md
+recursive-include erpnext *.png
+recursive-include erpnext *.py
+recursive-include erpnext *.svg
+recursive-include erpnext *.txt
+recursive-exclude * *.pyc
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
index c20b297..23a55d3 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -6,9 +6,9 @@
 cur_frm.cscript.other_fname = "purchase_tax_details";
 
 wn.provide("erpnext.accounts");
-wn.require('app/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js');
-wn.require('app/buying/doctype/purchase_common/purchase_common.js');
-wn.require('app/accounts/doctype/sales_invoice/pos.js');
+{% include 'buying/doctype/purchase_common/purchase_common.js' %};
+{% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %}
+{% include 'accounts/doctype/sales_invoice/pos.js' %}
 
 erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
 	onload: function() {
@@ -133,7 +133,7 @@
 
 cur_frm.fields_dict['entries'].grid.get_field("item_code").get_query = function(doc, cdt, cdn) {
 	return {
-		query:"controllers.queries.item_query",
+		query: "erpnext.controllers.queries.item_query",
 		filters:{
 			'is_purchase_item': 'Yes'	
 		}
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js
index 84521ed..b589651 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js
@@ -4,7 +4,7 @@
 // 
 
 //--------- ONLOAD -------------
-wn.require("app/js/controllers/accounts.js");
+{% include "public/js/controllers/accounts.js" %}
 
 cur_frm.cscript.onload = function(doc, cdt, cdn) {
    
@@ -139,7 +139,7 @@
 
 cur_frm.set_query("account_head", "purchase_tax_details", function(doc) {
 	return {
-		query: "controllers.queries.tax_account_query",
+		query: "erpnext.controllers.queries.tax_account_query",
     	filters: {
 			"account_type": ["Tax", "Chargeable", "Expense Account"],
 			"debit_or_credit": "Debit",
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 1940c6e..630dfe2 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -9,10 +9,10 @@
 // print heading
 cur_frm.pformat.print_heading = 'Invoice';
 
-wn.require('app/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js');
-wn.require('app/utilities/doctype/sms_control/sms_control.js');
-wn.require('app/selling/sales_common.js');
-wn.require('app/accounts/doctype/sales_invoice/pos.js');
+{% include 'selling/sales_common.js' %};
+{% include 'accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js' %}
+{% include 'utilities/doctype/sms_control/sms_control.js' %}
+{% include 'accounts/doctype/sales_invoice/pos.js' %}
 
 wn.provide("erpnext.accounts");
 erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.extend({
@@ -115,7 +115,7 @@
 						};
 						if(cur_frm.doc.customer) filters["customer"] = cur_frm.doc.customer;
 						return {
-							query: "controllers.queries.get_delivery_notes_to_be_billed",
+							query: "erpnext.controllers.queries.get_delivery_notes_to_be_billed",
 							filters: filters
 						};
 					}
@@ -324,7 +324,7 @@
 //--------------------------
 cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) {
 	return{
-		query: "controllers.queries.get_project_name",
+		query: "erpnext.controllers.queries.get_project_name",
 		filters: {'customer': doc.customer}
 	}	
 }
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
index e2e5047..0cdead9 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
@@ -3,7 +3,7 @@
 
 //--------- ONLOAD -------------
 
-wn.require("app/js/controllers/accounts.js");
+{% include "public/js/controllers/accounts.js" %}
 
 cur_frm.cscript.onload = function(doc, cdt, cdn) {
 	if(doc.doctype === "Sales Taxes and Charges Master")
@@ -129,7 +129,7 @@
 
 cur_frm.fields_dict['other_charges'].grid.get_field("account_head").get_query = function(doc,cdt,cdn) {
 	return{
-		query: "controllers.queries.tax_account_query",
+		query: "erpnext.controllers.queries.tax_account_query",
     	filters: {
 			"account_type": ["Tax", "Chargeable", "Income Account"],
 			"debit_or_credit": "Credit",
diff --git a/erpnext/accounts/page/financial_analytics/financial_analytics.js b/erpnext/accounts/page/financial_analytics/financial_analytics.js
index 7fe0507..4c7c644 100644
--- a/erpnext/accounts/page/financial_analytics/financial_analytics.js
+++ b/erpnext/accounts/page/financial_analytics/financial_analytics.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require("app/js/account_tree_grid.js");
+wn.require("assets/erpnext/js/account_tree_grid.js");
 
 wn.pages['financial-analytics'].onload = function(wrapper) { 
 	wn.ui.make_app_page({
diff --git a/erpnext/accounts/page/trial_balance/trial_balance.js b/erpnext/accounts/page/trial_balance/trial_balance.js
index 83f56eb..34a0695 100644
--- a/erpnext/accounts/page/trial_balance/trial_balance.js
+++ b/erpnext/accounts/page/trial_balance/trial_balance.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require("app/js/account_tree_grid.js");
+wn.require("assets/erpnext/js/account_tree_grid.js");
 
 wn.pages['trial-balance'].onload = function(wrapper) { 
 	wn.ui.make_app_page({
diff --git a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.js b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.js
index 183e16a..7ab4ffa 100644
--- a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.js
+++ b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require("app/js/purchase_trends_filters.js");
+wn.require("assets/erpnext/js/purchase_trends_filters.js");
 
 wn.query_reports["Purchase Invoice Trends"] = {
 	filters: get_filters()
diff --git a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.js b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.js
index 3b004ab..0ffb6e0 100644
--- a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.js
+++ b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require("app/js/sales_trends_filters.js");
+wn.require("assets/erpnext/js/sales_trends_filters.js");
 
 wn.query_reports["Sales Invoice Trends"] = {
 	filters: get_filters()
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js
index 86b252d..cc24925 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.js
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.js
@@ -7,8 +7,8 @@
 // cur_frm.cscript.fname - Details fieldname
 
 wn.provide("erpnext.buying");
-wn.require("app/js/transaction.js");
-wn.require("app/js/controllers/accounts.js");
+wn.require("assets/erpnext/js/transaction.js");
+{% include "public/js/controllers/accounts.js" %}
 
 erpnext.buying.BuyingController = erpnext.TransactionController.extend({
 	onload: function() {
@@ -37,18 +37,18 @@
 		
 		if(this.frm.fields_dict.supplier) {
 			this.frm.set_query("supplier", function() {
-				return{	query:"controllers.queries.supplier_query" }});
+				return{	query: "erpnext.controllers.queries.supplier_query" }});
 		}
 		
 		this.frm.set_query("item_code", this.frm.cscript.fname, function() {
 			if(me.frm.doc.is_subcontracted == "Yes") {
 				 return{
-					query:"controllers.queries.item_query",
+					query: "erpnext.controllers.queries.item_query",
 					filters:{ 'is_sub_contracted_item': 'Yes' }
 				}
 			} else {
 				return{
-					query: "controllers.queries.item_query",
+					query: "erpnext.controllers.queries.item_query",
 					filters: { 'is_purchase_item': 'Yes' }
 				}				
 			}
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index 7db0035..edf7c82 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -7,10 +7,10 @@
 cur_frm.cscript.fname = "po_details";
 cur_frm.cscript.other_fname = "purchase_tax_details";
 
-wn.require('app/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js');
-wn.require('app/utilities/doctype/sms_control/sms_control.js');
-wn.require('app/buying/doctype/purchase_common/purchase_common.js');
-wn.require('app/accounts/doctype/sales_invoice/pos.js');
+{% include 'buying/doctype/purchase_common/purchase_common.js' %};
+{% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %}
+{% include 'utilities/doctype/sms_control/sms_control.js' %}
+{% include 'accounts/doctype/sales_invoice/pos.js' %}
 
 erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend({
 	refresh: function(doc, cdt, cdn) {
diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js
index aa8ea2a..e1780ab 100644
--- a/erpnext/buying/doctype/supplier/supplier.js
+++ b/erpnext/buying/doctype/supplier/supplier.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require('app/setup/doctype/contact_control/contact_control.js');
+{% include 'setup/doctype/contact_control/contact_control.js' %};
 
 cur_frm.cscript.refresh = function(doc,dt,dn) {
 	cur_frm.cscript.make_dashboard(doc);
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js
index 597ad86..bc56abd 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js
@@ -7,9 +7,9 @@
 cur_frm.cscript.other_fname = "purchase_tax_details";
 
 // attach required files
-wn.require('app/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js');
-wn.require('app/buying/doctype/purchase_common/purchase_common.js');
-wn.require('app/accounts/doctype/sales_invoice/pos.js');
+{% include 'buying/doctype/purchase_common/purchase_common.js' %};
+{% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %}
+{% include 'accounts/doctype/sales_invoice/pos.js' %}
 
 erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.extend({
 	refresh: function() {
diff --git a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.js b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.js
index 2c7ffc0..d5371d3 100644
--- a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.js
+++ b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require("app/js/purchase_trends_filters.js");
+wn.require("assets/erpnext/js/purchase_trends_filters.js");
 
 wn.query_reports["Purchase Order Trends"] = {
 	filters: get_filters()
diff --git a/erpnext/hooks.txt b/erpnext/hooks.txt
new file mode 100644
index 0000000..4e6d473
--- /dev/null
+++ b/erpnext/hooks.txt
@@ -0,0 +1,10 @@
+app_name			ERPNext
+
+app_include_js 		assets/js/erpnext.min.js
+app_include_css 	assets/css/erpnext.css
+get_desktop_icons 	erpnext.manage.get_desktop_icons
+boot_session		erpnext.startup.boot.boot_session
+
+standard_queries	Warehouse	erpnext.stock.utils.get_warehouse_list
+standard_queries	Customer	erpnext.selling.utils.get_customer_list
+
diff --git a/erpnext/hr/doctype/appraisal/appraisal.js b/erpnext/hr/doctype/appraisal/appraisal.js
index e3626b0..29157d0 100644
--- a/erpnext/hr/doctype/appraisal/appraisal.js
+++ b/erpnext/hr/doctype/appraisal/appraisal.js
@@ -71,5 +71,5 @@
 }
 
 cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
-	return{	query:"controllers.queries.employee_query" }	
+	return{	query: "erpnext.controllers.queries.employee_query" }	
 }
\ No newline at end of file
diff --git a/erpnext/hr/doctype/attendance/attendance.js b/erpnext/hr/doctype/attendance/attendance.js
index be2b39d..ff7d7dd 100644
--- a/erpnext/hr/doctype/attendance/attendance.js
+++ b/erpnext/hr/doctype/attendance/attendance.js
@@ -10,6 +10,6 @@
 
 cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
 	return{
-		query:"controllers.queries.employee_query"
+		query: "erpnext.controllers.queries.employee_query"
 	}	
 }
diff --git a/erpnext/hr/doctype/employee/employee.js b/erpnext/hr/doctype/employee/employee.js
index 55be526..1df6175 100644
--- a/erpnext/hr/doctype/employee/employee.js
+++ b/erpnext/hr/doctype/employee/employee.js
@@ -7,7 +7,7 @@
 		this.frm.fields_dict.user_id.get_query = function(doc,cdt,cdn) {
 				return { query:"core.doctype.profile.profile.profile_query"} }
 		this.frm.fields_dict.reports_to.get_query = function(doc,cdt,cdn) {	
-			return{	query:"controllers.queries.employee_query"}	}
+			return{	query: "erpnext.controllers.queries.employee_query"}	}
 	},
 	
 	onload: function() {
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js
index c65fe0a..1a16dde 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.js
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.js
@@ -55,7 +55,7 @@
 	
 	cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
 		return{
-			query:"controllers.queries.employee_query"
+			query: "erpnext.controllers.queries.employee_query"
 		}	
 	}
 	var exp_approver = doc.exp_approver;
diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.js b/erpnext/hr/doctype/leave_allocation/leave_allocation.js
index 4bc3c49..1e376da 100755
--- a/erpnext/hr/doctype/leave_allocation/leave_allocation.js
+++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.js
@@ -68,6 +68,6 @@
 
 cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
   return{
-    query:"controllers.queries.employee_query"
+    query: "erpnext.controllers.queries.employee_query"
   } 
 }
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js
index 3716953..ceab148 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.js
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.js
@@ -123,6 +123,6 @@
 
 cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
 	return{
-		query:"controllers.queries.employee_query"
+		query: "erpnext.controllers.queries.employee_query"
 	}		
 }
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.js b/erpnext/hr/doctype/salary_structure/salary_structure.js
index dd9ab97..24da8a0 100644
--- a/erpnext/hr/doctype/salary_structure/salary_structure.js
+++ b/erpnext/hr/doctype/salary_structure/salary_structure.js
@@ -60,5 +60,5 @@
 }
 
 cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
-  return{ query:"controllers.queries.employee_query" } 
+  return{ query: "erpnext.controllers.queries.employee_query" } 
 }
\ No newline at end of file
diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.js b/erpnext/hr/doctype/upload_attendance/upload_attendance.js
index aed3d7f..ee58945 100644
--- a/erpnext/hr/doctype/upload_attendance/upload_attendance.js
+++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.js
@@ -2,7 +2,7 @@
 // License: GNU General Public License v3. See license.txt
 
 
-wn.require("public/app/js/utils.js");
+wn.require("assets/erpnext/js/utils.js");
 wn.provide("erpnext.hr");
 
 erpnext.hr.AttendanceControlPanel = wn.ui.form.Controller.extend({
diff --git a/erpnext/manage.py b/erpnext/manage.py
index 6f62673..fe18d20 100644
--- a/erpnext/manage.py
+++ b/erpnext/manage.py
@@ -5,14 +5,6 @@
 
 import webnotes
 
-def get_hooks():
-	return {
-		"app_include_js": ["assets/js/erpnext.min.js"],
-		"app_include_css": ["assets/css/erpnext.css"],
-		"desktop_icons": get_desktop_icons(),
-		"boot_session": ["erpnext.startup.boot.boot_session"]
-	}
-
 def after_install():
 	import_defaults()
 	import_country_and_currency()
diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js
index a43e5da..c0dcdfc 100644
--- a/erpnext/manufacturing/doctype/bom/bom.js
+++ b/erpnext/manufacturing/doctype/bom/bom.js
@@ -167,7 +167,7 @@
 
 cur_frm.fields_dict['item'].get_query = function(doc) {
  	return{
-		query:"controllers.queries.item_query",
+		query: "erpnext.controllers.queries.item_query",
 		filters:{
 			'is_manufactured_item': 'Yes'
 		}
@@ -184,7 +184,7 @@
 
 cur_frm.fields_dict['bom_materials'].grid.get_field('item_code').get_query = function(doc) {
 	return{
-		query:"controllers.queries.item_query"
+		query: "erpnext.controllers.queries.item_query"
 	}
 }
 
diff --git a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.js b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.js
index 3bf31f9..e5415ad 100644
--- a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.js
+++ b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.js
@@ -8,7 +8,7 @@
 
 cur_frm.set_query("current_bom", function(doc) {
 	return{
-		query:"controllers.queries.bom",
+		query: "erpnext.controllers.queries.bom",
 		filters: {name: "!" + doc.new_bom}
 	}
 });
@@ -16,7 +16,7 @@
 
 cur_frm.set_query("new_bom", function(doc) {
 	return{
-		query:"controllers.queries.bom",
+		query: "erpnext.controllers.queries.bom",
 		filters: {name: "!" + doc.current_bom}
 	}
 });
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js
index 075f8bd..1ace97b 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.js
+++ b/erpnext/manufacturing/doctype/production_order/production_order.js
@@ -102,7 +102,7 @@
 cur_frm.set_query("bom_no", function(doc) {
 	if (doc.production_item) {
 		return{
-			query:"controllers.queries.bom",
+			query: "erpnext.controllers.queries.bom",
 			filters: {item: cstr(doc.production_item)}
 		}
 	} else msgprint(wn._("Please enter Production Item first"));
diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js
index 870f01f..f52fb8d 100644
--- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js
+++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js
@@ -41,7 +41,7 @@
 	var d = locals[this.doctype][this.docname];
 	if (d.item_code) {
 		return {
-			query:"controllers.queries.bom",
+			query: "erpnext.controllers.queries.bom",
 			filters:{'item': cstr(d.item_code)}
 		}
 	} else msgprint(wn._("Please enter Item first"));
@@ -49,7 +49,7 @@
 
 cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
 	return{
-		query:"controllers.queries.customer_query"
+		query: "erpnext.controllers.queries.customer_query"
 	}
 }
 
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/patches.txt
diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js
index 30873b5..a77866e 100644
--- a/erpnext/projects/doctype/project/project.js
+++ b/erpnext/projects/doctype/project/project.js
@@ -17,6 +17,6 @@
 
 cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
 	return{
-		query:"controllers.queries.customer_query"
+		query: "erpnext.controllers.queries.customer_query"
 	}
 }
\ No newline at end of file
diff --git a/erpnext/public/build.json b/erpnext/public/build.json
index 3c681fc..dcad80c 100644
--- a/erpnext/public/build.json
+++ b/erpnext/public/build.json
@@ -12,5 +12,5 @@
 		"public/js/feature_setup.js",
 		"public/js/utils.js",
 		"public/js/queries.js"
-	]
+	],
 }
diff --git a/erpnext/public/js/queries.js b/erpnext/public/js/queries.js
index 3c60a91..621e340 100644
--- a/erpnext/public/js/queries.js
+++ b/erpnext/public/js/queries.js
@@ -9,27 +9,27 @@
 	},
 	
 	lead: function() {
-		return { query: "controllers.queries.lead_query" };
+		return { query: "erpnext.controllers.queries.lead_query" };
 	},
 	
 	customer: function() {
-		return { query: "controllers.queries.customer_query" };
+		return { query: "erpnext.controllers.queries.customer_query" };
 	},
 	
 	supplier: function() {
-		return { query: "controllers.queries.supplier_query" };
+		return { query: "erpnext.controllers.queries.supplier_query" };
 	},
 	
 	account: function() {
-		return { query: "controllers.queries.account_query" };
+		return { query: "erpnext.controllers.queries.account_query" };
 	},
 	
 	item: function() {
-		return { query: "controllers.queries.item_query" };
+		return { query: "erpnext.controllers.queries.item_query" };
 	},
 	
 	bom: function() {
-		return { query: "controllers.queries.bom" };
+		return { query: "erpnext.controllers.queries.bom" };
 	},
 	
 	task: function() {
diff --git a/erpnext/public/js/stock_analytics.js b/erpnext/public/js/stock_analytics.js
index 832cac5..ba41318 100644
--- a/erpnext/public/js/stock_analytics.js
+++ b/erpnext/public/js/stock_analytics.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require("app/js/stock_grid_report.js");
+wn.require("assets/erpnext/js/stock_grid_report.js");
 
 erpnext.StockAnalytics = erpnext.StockGridReport.extend({
 	init: function(wrapper, opts) {
diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js
index 96f10c7..5b48820 100644
--- a/erpnext/public/js/transaction.js
+++ b/erpnext/public/js/transaction.js
@@ -2,7 +2,7 @@
 // License: GNU General Public License v3. See license.txt
 
 wn.provide("erpnext");
-wn.require("app/js/controllers/stock_controller.js");
+wn.require("assets/erpnext/js/controllers/stock_controller.js");
 
 erpnext.TransactionController = erpnext.stock.StockController.extend({
 	onload: function() {
diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js
index 8ec4a2b..e8130ae 100644
--- a/erpnext/selling/doctype/customer/customer.js
+++ b/erpnext/selling/doctype/customer/customer.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require('app/setup/doctype/contact_control/contact_control.js');
+{% include 'setup/doctype/contact_control/contact_control.js' %};
 
 cur_frm.cscript.onload = function(doc,dt,dn){
 	cur_frm.cscript.load_defaults(doc, dt, dn);
@@ -116,7 +116,7 @@
 
 cur_frm.fields_dict.lead_name.get_query = function(doc,cdt,cdn) {
 	return{
-		query:"controllers.queries.lead_query"
+		query: "erpnext.controllers.queries.lead_query"
 	}
 }
 
diff --git a/erpnext/selling/doctype/installation_note/installation_note.js b/erpnext/selling/doctype/installation_note/installation_note.js
index d96b993..223bd8d 100644
--- a/erpnext/selling/doctype/installation_note/installation_note.js
+++ b/erpnext/selling/doctype/installation_note/installation_note.js
@@ -37,7 +37,7 @@
 		
 		this.frm.set_query("customer", function() {
 			return {
-				query: "controllers.queries.customer_query"
+				query: "erpnext.controllers.queries.customer_query"
 			}
 		});
 	},
diff --git a/erpnext/selling/doctype/lead/lead.js b/erpnext/selling/doctype/lead/lead.js
index cf972b6..4ab1067 100644
--- a/erpnext/selling/doctype/lead/lead.js
+++ b/erpnext/selling/doctype/lead/lead.js
@@ -1,14 +1,14 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require('app/utilities/doctype/sms_control/sms_control.js');
-wn.require('app/setup/doctype/contact_control/contact_control.js');
+{% include 'setup/doctype/contact_control/contact_control.js' %};
+{% include 'utilities/doctype/sms_control/sms_control.js' %}
 
 wn.provide("erpnext");
 erpnext.LeadController = wn.ui.form.Controller.extend({
 	setup: function() {
 		this.frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
-				return { query:"controllers.queries.customer_query" } }
+				return { query: "erpnext.controllers.queries.customer_query" } }
 	},
 	
 	onload: function() {
diff --git a/erpnext/selling/doctype/opportunity/opportunity.js b/erpnext/selling/doctype/opportunity/opportunity.js
index 5fc84fa..396def8 100644
--- a/erpnext/selling/doctype/opportunity/opportunity.js
+++ b/erpnext/selling/doctype/opportunity/opportunity.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require('app/utilities/doctype/sms_control/sms_control.js');
+{% include 'utilities/doctype/sms_control/sms_control.js' %};
 
 wn.provide("erpnext.selling");
 // TODO commonify this code
@@ -60,7 +60,7 @@
 		
 		this.frm.set_query("item_code", "enquiry_details", function() {
 			return {
-				query: "controllers.queries.item_query",
+				query: "erpnext.controllers.queries.item_query",
 				filters: me.frm.doc.enquiry_type === "Maintenance" ? 
 					{"is_service_item": "Yes"} : {"is_sales_item": "Yes"}
 			};
diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js
index 9f145ce..bb2ce8c 100644
--- a/erpnext/selling/doctype/quotation/quotation.js
+++ b/erpnext/selling/doctype/quotation/quotation.js
@@ -8,10 +8,10 @@
 cur_frm.cscript.other_fname = "other_charges";
 cur_frm.cscript.sales_team_fname = "sales_team";
 
-wn.require('app/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js');
-wn.require('app/utilities/doctype/sms_control/sms_control.js');
-wn.require('app/selling/sales_common.js');
-wn.require('app/accounts/doctype/sales_invoice/pos.js');
+{% include 'selling/sales_common.js' %}
+{% include 'accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js' %}
+{% include 'utilities/doctype/sms_control/sms_control.js' %}
+{% include 'accounts/doctype/sales_invoice/pos.js' %}
 
 erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
 	onload: function(doc, dt, dn) {
@@ -90,7 +90,7 @@
 cur_frm.script_manager.make(erpnext.selling.QuotationController);
 
 cur_frm.fields_dict.lead.get_query = function(doc,cdt,cdn) {
-	return{	query:"controllers.queries.lead_query" } }
+	return{	query: "erpnext.controllers.queries.lead_query" } }
 
 cur_frm.cscript.lead = function(doc, cdt, cdn) {
 	if(doc.lead) {
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index a8ba502..f393945 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -8,11 +8,10 @@
 cur_frm.cscript.other_fname = "other_charges";
 cur_frm.cscript.sales_team_fname = "sales_team";
 
-
-wn.require('app/selling/sales_common.js');
-wn.require('app/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js');
-wn.require('app/utilities/doctype/sms_control/sms_control.js');
-wn.require('app/accounts/doctype/sales_invoice/pos.js');
+{% include 'selling/sales_common.js' %}
+{% include 'accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js' %}
+{% include 'utilities/doctype/sms_control/sms_control.js' %}
+{% include 'accounts/doctype/sales_invoice/pos.js' %}
 
 erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend({
 	refresh: function(doc, dt, dn) {
@@ -148,7 +147,7 @@
 
 cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) {
 	return {
-		query: "controllers.queries.get_project_name",
+		query: "erpnext.controllers.queries.get_project_name",
 		filters: {
 			'customer': doc.customer
 		}
diff --git a/erpnext/selling/report/quotation_trends/quotation_trends.js b/erpnext/selling/report/quotation_trends/quotation_trends.js
index f26e873..59f8b46 100644
--- a/erpnext/selling/report/quotation_trends/quotation_trends.js
+++ b/erpnext/selling/report/quotation_trends/quotation_trends.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require("app/js/sales_trends_filters.js");
+wn.require("assets/erpnext/js/sales_trends_filters.js");
 
 wn.query_reports["Quotation Trends"] = {
 	filters: get_filters()
diff --git a/erpnext/selling/report/sales_order_trends/sales_order_trends.js b/erpnext/selling/report/sales_order_trends/sales_order_trends.js
index 6268400..6ff31a2 100644
--- a/erpnext/selling/report/sales_order_trends/sales_order_trends.js
+++ b/erpnext/selling/report/sales_order_trends/sales_order_trends.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require("app/js/sales_trends_filters.js");
+wn.require("assets/erpnext/js/sales_trends_filters.js");
 
 wn.query_reports["Sales Order Trends"] = {
 	filters: get_filters()
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index c5eb38c..ae16413 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -5,12 +5,12 @@
 // ------
 // cur_frm.cscript.tname - Details table name
 // cur_frm.cscript.fname - Details fieldname
-// cur_frm.cscript.other_fname - wn.require('app/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js'); fieldname
+// cur_frm.cscript.other_fname - fieldname
 // cur_frm.cscript.sales_team_fname - Sales Team fieldname
 
 wn.provide("erpnext.selling");
-wn.require("app/js/transaction.js");
-wn.require("app/js/controllers/accounts.js");
+wn.require("assets/erpnext/js/transaction.js");
+{% include "public/js/controllers/accounts.js" %}
 
 erpnext.selling.SellingController = erpnext.TransactionController.extend({
 	onload: function() {
@@ -59,7 +59,7 @@
 		if(this.frm.fields_dict[this.fname].grid.get_field('item_code')) {
 			this.frm.set_query("item_code", this.fname, function() {
 				return {
-					query: "controllers.queries.item_query",
+					query: "erpnext.controllers.queries.item_query",
 					filters: (me.frm.doc.order_type === "Maintenance" ?
 						{'is_service_item': 'Yes'}:
 						{'is_sales_item': 'Yes'	})
diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.js b/erpnext/setup/doctype/authorization_rule/authorization_rule.js
index cdf8ef0..bd42618 100644
--- a/erpnext/setup/doctype/authorization_rule/authorization_rule.js
+++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.js
@@ -100,7 +100,7 @@
   else if(doc.based_on == 'Itemwise Discount')
     return {
 	  doctype: "Item",
-      query: "controllers.queries.item_query"
+      query: "erpnext.controllers.queries.item_query"
     }
   else
     return {
@@ -111,4 +111,4 @@
 }
 
 cur_frm.fields_dict.to_emp.get_query = function(doc,cdt,cdn) {
-  return{ query:"controllers.queries.employee_query" } }
\ No newline at end of file
+  return{ query: "erpnext.controllers.queries.employee_query" } }
\ No newline at end of file
diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.js b/erpnext/setup/doctype/sales_partner/sales_partner.js
index 0576857..57eca34 100644
--- a/erpnext/setup/doctype/sales_partner/sales_partner.js
+++ b/erpnext/setup/doctype/sales_partner/sales_partner.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require('app/setup/doctype/contact_control/contact_control.js');
+{% include 'setup/doctype/contact_control/contact_control.js' %};
 
 cur_frm.cscript.onload = function(doc,dt,dn){
 
diff --git a/erpnext/setup/doctype/sales_person/sales_person.js b/erpnext/setup/doctype/sales_person/sales_person.js
index 55d8684..a25a3d1 100644
--- a/erpnext/setup/doctype/sales_person/sales_person.js
+++ b/erpnext/setup/doctype/sales_person/sales_person.js
@@ -37,4 +37,4 @@
 }
 
 cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
-	return{	query:"controllers.queries.employee_query" } }
\ No newline at end of file
+	return{	query: "erpnext.controllers.queries.employee_query" } }
\ No newline at end of file
diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py
index adb031c..3258db3 100644
--- a/erpnext/setup/page/setup_wizard/setup_wizard.py
+++ b/erpnext/setup/page/setup_wizard/setup_wizard.py
@@ -165,8 +165,8 @@
 			
 def create_feed_and_todo():
 	"""update activty feed and create todo for creation of item, customer, vendor"""
-	import home
-	home.make_feed('Comment', 'ToDo', '', webnotes.session['user'],
+	from erpnext.home import make_feed
+	make_feed('Comment', 'ToDo', '', webnotes.session['user'],
 		'ERNext Setup Complete!', '#6B24B3')
 
 def create_email_digest():
diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py
index 48c2aa0..7d51872 100644
--- a/erpnext/startup/event_handlers.py
+++ b/erpnext/startup/event_handlers.py
@@ -4,7 +4,8 @@
 
 from __future__ import unicode_literals
 import webnotes
-import home
+
+from erpnext.home import make_feed
 
 def on_login_post_session(login_manager):
 	"""
@@ -25,7 +26,7 @@
 		from webnotes.utils import nowtime
 		from webnotes.profile import get_user_fullname
 		webnotes.conn.begin()
-		home.make_feed('Login', 'Profile', login_manager.user, login_manager.user,
+		make_feed('Login', 'Profile', login_manager.user, login_manager.user,
 			'%s logged in at %s' % (get_user_fullname(login_manager.user), nowtime()), 
 			login_manager.user=='Administrator' and '#8CA2B3' or '#1B750D')
 		webnotes.conn.commit()
@@ -66,6 +67,6 @@
 
 def comment_added(doc):
 	"""add comment to feed"""
-	home.make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by,
+	make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by,
 		'<i>"' + doc.comment + '"</i>', '#6B24B3')
 	
diff --git a/erpnext/startup/query_handlers.py b/erpnext/startup/query_handlers.py
deleted file mode 100644
index 753d088..0000000
--- a/erpnext/startup/query_handlers.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-
-standard_queries = {
-	"Warehouse": "stock.utils.get_warehouse_list",
-	"Customer": "selling.utils.get_customer_list",
-}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/batch/batch.js b/erpnext/stock/doctype/batch/batch.js
index 51e7470..cc142ed 100644
--- a/erpnext/stock/doctype/batch/batch.js
+++ b/erpnext/stock/doctype/batch/batch.js
@@ -3,7 +3,7 @@
 
 cur_frm.fields_dict['item'].get_query = function(doc, cdt, cdn) {
 	return {
-		query:"controllers.queries.item_query",
+		query: "erpnext.controllers.queries.item_query",
 		filters:{
 			'is_stock_item': 'Yes'	
 		}
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js
index 796bf0f..56329a1 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.js
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.js
@@ -7,10 +7,10 @@
 cur_frm.cscript.other_fname = "other_charges";
 cur_frm.cscript.sales_team_fname = "sales_team";
 
-wn.require('app/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js');
-wn.require('app/utilities/doctype/sms_control/sms_control.js');
-wn.require('app/selling/sales_common.js');
-wn.require('app/accounts/doctype/sales_invoice/pos.js');
+{% include 'selling/sales_common.js' %};
+{% include 'accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js' %}
+{% include 'utilities/doctype/sms_control/sms_control.js' %}
+{% include 'accounts/doctype/sales_invoice/pos.js' %}
 
 wn.provide("erpnext.stock");
 erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend({
@@ -106,7 +106,7 @@
 // ***************** Get project name *****************
 cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) {
 	return {
-		query: "controllers.queries.get_project_name",
+		query: "erpnext.controllers.queries.get_project_name",
 		filters: {
 			'customer': doc.customer
 		}
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index c9aa75e..1ee5e04 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -151,11 +151,11 @@
 
 cur_frm.fields_dict.item_customer_details.grid.get_field("customer_name").get_query = 
 function(doc,cdt,cdn) {
-		return{	query:"controllers.queries.customer_query" } }
+		return{	query: "erpnext.controllers.queries.customer_query" } }
 	
 cur_frm.fields_dict.item_supplier_details.grid.get_field("supplier").get_query = 
 	function(doc,cdt,cdn) {
-		return{ query:"controllers.queries.supplier_query" } }
+		return{ query: "erpnext.controllers.queries.supplier_query" } }
 
 cur_frm.cscript.copy_from_item_group = function(doc) {
 	wn.model.with_doc("Item Group", doc.item_group, function() {
diff --git a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.js b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.js
index 68f1bd0..86b34c0 100644
--- a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.js
+++ b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.js
@@ -3,7 +3,7 @@
 
 
 wn.provide("erpnext.stock");
-wn.require("public/app/js/controllers/stock_controller.js");
+wn.require("assets/erpnext/js/controllers/stock_controller.js");
 
 erpnext.stock.LandedCostWizard = erpnext.stock.StockController.extend({		
 	setup: function() {
diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js
index 7dca935..31a5753 100644
--- a/erpnext/stock/doctype/material_request/material_request.js
+++ b/erpnext/stock/doctype/material_request/material_request.js
@@ -4,8 +4,8 @@
 cur_frm.cscript.tname = "Material Request Item";
 cur_frm.cscript.fname = "indent_details";
 
-wn.require('app/utilities/doctype/sms_control/sms_control.js');
-wn.require('app/buying/doctype/purchase_common/purchase_common.js');
+{% include 'buying/doctype/purchase_common/purchase_common.js' %};
+{% include 'utilities/doctype/sms_control/sms_control.js' %}
 
 erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.extend({
 	refresh: function(doc) {
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
index 59a6063..5151c00 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
@@ -5,10 +5,10 @@
 cur_frm.cscript.fname = "purchase_receipt_details";
 cur_frm.cscript.other_fname = "purchase_tax_details";
 
-wn.require('app/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js');
-wn.require('app/utilities/doctype/sms_control/sms_control.js');
-wn.require('app/buying/doctype/purchase_common/purchase_common.js');
-wn.require('app/accounts/doctype/sales_invoice/pos.js');
+{% include 'buying/doctype/purchase_common/purchase_common.js' %};
+{% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %}
+{% include 'utilities/doctype/sms_control/sms_control.js' %}
+{% include 'accounts/doctype/sales_invoice/pos.js' %}
 
 wn.provide("erpnext.stock");
 erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend({
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index d5c54b5..abfd0e2 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -4,7 +4,7 @@
 cur_frm.cscript.tname = "Stock Entry Detail";
 cur_frm.cscript.fname = "mtn_details";
 
-wn.require("public/app/js/controllers/stock_controller.js");
+wn.require("assets/erpnext/js/controllers/stock_controller.js");
 wn.provide("erpnext.stock");
 
 erpnext.stock.StockEntry = erpnext.stock.StockController.extend({		
@@ -386,9 +386,9 @@
 }
 
 cur_frm.fields_dict.customer.get_query = function(doc, cdt, cdn) {
-	return{ query:"controllers.queries.customer_query" }
+	return{ query: "erpnext.controllers.queries.customer_query" }
 }
 
 cur_frm.fields_dict.supplier.get_query = function(doc, cdt, cdn) {
-	return{	query:"controllers.queries.supplier_query" }
+	return{	query: "erpnext.controllers.queries.supplier_query" }
 }
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
index bf08738..63f2032 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require("public/app/js/controllers/stock_controller.js");
+wn.require("assets/erpnext/js/controllers/stock_controller.js");
 wn.provide("erpnext.stock");
 
 erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({
diff --git a/erpnext/stock/page/stock_ageing/stock_ageing.js b/erpnext/stock/page/stock_ageing/stock_ageing.js
index 6c626e2..33dbf54 100644
--- a/erpnext/stock/page/stock_ageing/stock_ageing.js
+++ b/erpnext/stock/page/stock_ageing/stock_ageing.js
@@ -16,7 +16,7 @@
 	
 }
 
-wn.require("app/js/stock_grid_report.js");
+wn.require("assets/erpnext/js/stock_grid_report.js");
 
 erpnext.StockAgeing = erpnext.StockGridReport.extend({
 	init: function(wrapper) {
diff --git a/erpnext/stock/page/stock_analytics/stock_analytics.js b/erpnext/stock/page/stock_analytics/stock_analytics.js
index 3fb4a85..ba2c55a 100644
--- a/erpnext/stock/page/stock_analytics/stock_analytics.js
+++ b/erpnext/stock/page/stock_analytics/stock_analytics.js
@@ -16,4 +16,4 @@
 	
 }
 
-wn.require("app/js/stock_analytics.js");
\ No newline at end of file
+wn.require("assets/erpnext/js/stock_analytics.js");
\ No newline at end of file
diff --git a/erpnext/stock/page/stock_balance/stock_balance.js b/erpnext/stock/page/stock_balance/stock_balance.js
index 604312f..cc293a4 100644
--- a/erpnext/stock/page/stock_balance/stock_balance.js
+++ b/erpnext/stock/page/stock_balance/stock_balance.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require("app/js/stock_analytics.js");
+wn.require("assets/erpnext/js/stock_analytics.js");
 
 wn.pages['stock-balance'].onload = function(wrapper) { 
 	wn.ui.make_app_page({
diff --git a/erpnext/stock/page/stock_ledger/stock_ledger.js b/erpnext/stock/page/stock_ledger/stock_ledger.js
index 08a455e..a8a966f 100644
--- a/erpnext/stock/page/stock_ledger/stock_ledger.js
+++ b/erpnext/stock/page/stock_ledger/stock_ledger.js
@@ -12,7 +12,7 @@
 	wrapper.appframe.add_module_icon("Stock")
 }
 
-wn.require("app/js/stock_grid_report.js");
+wn.require("assets/erpnext/js/stock_grid_report.js");
 
 erpnext.StockLedger = erpnext.StockGridReport.extend({
 	init: function(wrapper) {
diff --git a/erpnext/stock/page/stock_level/stock_level.js b/erpnext/stock/page/stock_level/stock_level.js
index c508791..8cef636 100644
--- a/erpnext/stock/page/stock_level/stock_level.js
+++ b/erpnext/stock/page/stock_level/stock_level.js
@@ -15,7 +15,7 @@
 	;
 }
 
-wn.require("app/js/stock_grid_report.js");
+wn.require("assets/erpnext/js/stock_grid_report.js");
 
 erpnext.StockLevel = erpnext.StockGridReport.extend({
 	init: function(wrapper) {
diff --git a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.js b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.js
index ab0147b..568d982 100644
--- a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.js
+++ b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require("app/js/sales_trends_filters.js");
+wn.require("assets/erpnext/js/sales_trends_filters.js");
 
 wn.query_reports["Delivery Note Trends"] = {
 	filters: get_filters()
diff --git a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.js b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.js
index c3397f7..f66fcfc 100644
--- a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.js
+++ b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require("app/js/purchase_trends_filters.js");
+wn.require("assets/erpnext/js/purchase_trends_filters.js");
 
 wn.query_reports["Purchase Receipt Trends"] = {
 	filters: get_filters()
diff --git a/erpnext/support/doctype/customer_issue/customer_issue.js b/erpnext/support/doctype/customer_issue/customer_issue.js
index 5d0ffb5..0ff3f17 100644
--- a/erpnext/support/doctype/customer_issue/customer_issue.js
+++ b/erpnext/support/doctype/customer_issue/customer_issue.js
@@ -103,4 +103,4 @@
 
 
 cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
-	return{	query:"controllers.queries.customer_query" } }
+	return{	query: "erpnext.controllers.queries.customer_query" } }
diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js
index f1b2ac8..75773e0 100644
--- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js
+++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js
@@ -108,4 +108,4 @@
 }
 
 cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
-  return{ query:"controllers.queries.customer_query" } }
+  return{ query: "erpnext.controllers.queries.customer_query" } }
diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.js b/erpnext/support/doctype/maintenance_visit/maintenance_visit.js
index 9b604b9..f571b9a 100644
--- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.js
+++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.js
@@ -104,5 +104,5 @@
 
 
 cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
-	return {query: "controllers.queries.customer_query" }
+	return {query: "erpnext.controllers.queries.customer_query" }
 }
\ No newline at end of file
diff --git a/erpnext/support/doctype/support_ticket/support_ticket.js b/erpnext/support/doctype/support_ticket/support_ticket.js
index b372825..b5224e7 100644
--- a/erpnext/support/doctype/support_ticket/support_ticket.js
+++ b/erpnext/support/doctype/support_ticket/support_ticket.js
@@ -2,7 +2,7 @@
 // License: GNU General Public License v3. See license.txt
 
 cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
-	return{	query:"controllers.queries.customer_query" } }
+	return{	query: "erpnext.controllers.queries.customer_query" } }
 
 wn.provide("erpnext.support");
 // TODO commonify this code
diff --git a/erpnext/utilities/doctype/address/address.js b/erpnext/utilities/doctype/address/address.js
index aa608ba..f56a709 100644
--- a/erpnext/utilities/doctype/address/address.js
+++ b/erpnext/utilities/doctype/address/address.js
@@ -1,4 +1,4 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require('app/controllers/js/contact_address_common.js');
\ No newline at end of file
+{% include 'controllers/js/contact_address_common.js' %};
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/contact/contact.js b/erpnext/utilities/doctype/contact/contact.js
index 81d35dd..3d3e556 100644
--- a/erpnext/utilities/doctype/contact/contact.js
+++ b/erpnext/utilities/doctype/contact/contact.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-wn.require('app/controllers/js/contact_address_common.js');
+{% include 'controllers/js/contact_address_common.js' %};
 
 cur_frm.cscript.refresh = function(doc) {
 	cur_frm.communication_view = new wn.views.CommunicationList({