install, web serving, session booting webnotes/wnframework#351
diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js
index 5e0ccc9..8ec4a2b 100644
--- a/erpnext/selling/doctype/customer/customer.js
+++ b/erpnext/selling/doctype/customer/customer.js
@@ -52,7 +52,7 @@
 	
 	return wn.call({
 		type: "GET",
-		method:"selling.doctype.customer.customer.get_dashboard_info",
+		method: "erpnext.selling.doctype.customer.customer.get_dashboard_info",
 		args: {
 			customer: cur_frm.doc.name
 		},
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index d00926f..185c74b 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -9,7 +9,7 @@
 import webnotes.defaults
 
 
-from utilities.transaction_base import TransactionBase
+from erpnext.utilities.transaction_base import TransactionBase
 
 class DocType(TransactionBase):
 	def __init__(self, doc, doclist=[]):
@@ -144,7 +144,7 @@
 			webnotes.conn.sql("update `tabLead` set status='Interested' where name=%s",self.doc.lead_name)
 			
 	def before_rename(self, olddn, newdn, merge=False):
-		from accounts.utils import rename_account_for
+		from erpnext.accounts.utils import rename_account_for
 		rename_account_for("Customer", olddn, newdn, merge)
 			
 	def after_rename(self, olddn, newdn, merge=False):
diff --git a/erpnext/selling/doctype/installation_note/installation_note.js b/erpnext/selling/doctype/installation_note/installation_note.js
index ea777e0..d96b993 100644
--- a/erpnext/selling/doctype/installation_note/installation_note.js
+++ b/erpnext/selling/doctype/installation_note/installation_note.js
@@ -47,7 +47,7 @@
 			cur_frm.add_custom_button(wn._('From Delivery Note'), 
 				function() {
 					wn.model.map_current_doc({
-						method: "stock.doctype.delivery_note.delivery_note.make_installation_note",
+						method: "erpnext.stock.doctype.delivery_note.delivery_note.make_installation_note",
 						source_doctype: "Delivery Note",
 						get_query_filters: {
 							docstatus: 1,
diff --git a/erpnext/selling/doctype/installation_note/installation_note.py b/erpnext/selling/doctype/installation_note/installation_note.py
index 026d7e1..253e43e 100644
--- a/erpnext/selling/doctype/installation_note/installation_note.py
+++ b/erpnext/selling/doctype/installation_note/installation_note.py
@@ -7,9 +7,9 @@
 from webnotes.utils import cstr, getdate
 from webnotes.model.bean import getlist
 from webnotes import msgprint
-from stock.utils import get_valid_serial_nos	
+from erpnext.stock.utils import get_valid_serial_nos	
 
-from utilities.transaction_base import TransactionBase
+from erpnext.utilities.transaction_base import TransactionBase
 
 class DocType(TransactionBase):
 	def __init__(self, doc, doclist=[]):
@@ -36,11 +36,11 @@
 		self.validate_installation_date()
 		self.check_item_table()
 		
-		from controllers.selling_controller import check_active_sales_items
+		from erpnext.controllers.selling_controller import check_active_sales_items
 		check_active_sales_items(self)
 
 	def validate_fiscal_year(self):
-		from accounts.utils import validate_fiscal_year
+		from erpnext.accounts.utils import validate_fiscal_year
 		validate_fiscal_year(self.doc.inst_date, self.doc.fiscal_year, "Installation Date")
 	
 	def is_serial_no_added(self, item_code, serial_no):
diff --git a/erpnext/selling/doctype/lead/lead.js b/erpnext/selling/doctype/lead/lead.js
index 54a249f..cf972b6 100644
--- a/erpnext/selling/doctype/lead/lead.js
+++ b/erpnext/selling/doctype/lead/lead.js
@@ -77,14 +77,14 @@
 	
 	create_customer: function() {
 		wn.model.open_mapped_doc({
-			method: "selling.doctype.lead.lead.make_customer",
+			method: "erpnext.selling.doctype.lead.lead.make_customer",
 			source_name: cur_frm.doc.name
 		})
 	}, 
 	
 	create_opportunity: function() {
 		wn.model.open_mapped_doc({
-			method: "selling.doctype.lead.lead.make_opportunity",
+			method: "erpnext.selling.doctype.lead.lead.make_opportunity",
 			source_name: cur_frm.doc.name
 		})
 	}
diff --git a/erpnext/selling/doctype/lead/lead.py b/erpnext/selling/doctype/lead/lead.py
index 26c06bb..e5f2b62 100644
--- a/erpnext/selling/doctype/lead/lead.py
+++ b/erpnext/selling/doctype/lead/lead.py
@@ -8,7 +8,7 @@
 from webnotes import session, msgprint
 
 	
-from controllers.selling_controller import SellingController
+from erpnext.controllers.selling_controller import SellingController
 
 class DocType(SellingController):
 	def __init__(self, doc, doclist):
diff --git a/erpnext/selling/doctype/lead/test_lead.py b/erpnext/selling/doctype/lead/test_lead.py
index ec18ff7..d3f6f03 100644
--- a/erpnext/selling/doctype/lead/test_lead.py
+++ b/erpnext/selling/doctype/lead/test_lead.py
@@ -19,7 +19,7 @@
 
 class TestLead(unittest.TestCase):
 	def test_make_customer(self):
-		from selling.doctype.lead.lead import make_customer
+		from erpnext.selling.doctype.lead.lead import make_customer
 
 		customer = make_customer("_T-Lead-00001")
 		self.assertEquals(customer[0]["doctype"], "Customer")
diff --git a/erpnext/selling/doctype/opportunity/opportunity.js b/erpnext/selling/doctype/opportunity/opportunity.js
index 05970fc..5fc84fa 100644
--- a/erpnext/selling/doctype/opportunity/opportunity.js
+++ b/erpnext/selling/doctype/opportunity/opportunity.js
@@ -91,7 +91,7 @@
 	
 	create_quotation: function() {
 		wn.model.open_mapped_doc({
-			method: "selling.doctype.opportunity.opportunity.make_quotation",
+			method: "erpnext.selling.doctype.opportunity.opportunity.make_quotation",
 			source_name: cur_frm.doc.name
 		})
 	}
@@ -162,7 +162,7 @@
 	cur_frm.toggle_display("contact_info", doc.customer || doc.lead);
 	
 	wn.model.map_current_doc({
-		method: "selling.doctype.lead.lead.make_opportunity",
+		method: "erpnext.selling.doctype.lead.lead.make_opportunity",
 		source_name: cur_frm.doc.lead
 	})
 	
diff --git a/erpnext/selling/doctype/opportunity/opportunity.py b/erpnext/selling/doctype/opportunity/opportunity.py
index e6c0afe..00a447f 100644
--- a/erpnext/selling/doctype/opportunity/opportunity.py
+++ b/erpnext/selling/doctype/opportunity/opportunity.py
@@ -9,7 +9,7 @@
 from webnotes import msgprint, _
 
 	
-from utilities.transaction_base import TransactionBase
+from erpnext.utilities.transaction_base import TransactionBase
 
 class DocType(TransactionBase):
 	def __init__(self,doc,doclist):
@@ -104,7 +104,7 @@
 		self.validate_uom_is_integer("uom", "qty")
 		self.validate_lead_cust()
 		
-		from accounts.utils import validate_fiscal_year
+		from erpnext.accounts.utils import validate_fiscal_year
 		validate_fiscal_year(self.doc.transaction_date, self.doc.fiscal_year, "Opportunity Date")
 
 	def on_submit(self):
diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js
index c7bf447..9f145ce 100644
--- a/erpnext/selling/doctype/quotation/quotation.js
+++ b/erpnext/selling/doctype/quotation/quotation.js
@@ -39,7 +39,7 @@
 			cur_frm.add_custom_button(wn._('From Opportunity'), 
 				function() {
 					wn.model.map_current_doc({
-						method: "selling.doctype.opportunity.opportunity.make_quotation",
+						method: "erpnext.selling.doctype.opportunity.opportunity.make_quotation",
 						source_doctype: "Opportunity",
 						get_query_filters: {
 							docstatus: 1,
@@ -112,7 +112,7 @@
 // =====================================================================================
 cur_frm.cscript['Make Sales Order'] = function() {
 	wn.model.open_mapped_doc({
-		method: "selling.doctype.quotation.quotation.make_sales_order",
+		method: "erpnext.selling.doctype.quotation.quotation.make_sales_order",
 		source_name: cur_frm.doc.name
 	})
 }
diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py
index f2546b9..6a030b9 100644
--- a/erpnext/selling/doctype/quotation/quotation.py
+++ b/erpnext/selling/doctype/quotation/quotation.py
@@ -11,7 +11,7 @@
 
 	
 
-from controllers.selling_controller import SellingController
+from erpnext.controllers.selling_controller import SellingController
 
 class DocType(SellingController):
 	def __init__(self, doc, doclist=[]):
@@ -150,7 +150,7 @@
 		lead_name = quotation[0]
 		customer_name = webnotes.conn.get_value("Customer", {"lead_name": lead_name})
 		if not customer_name:
-			from selling.doctype.lead.lead import _make_customer
+			from erpnext.selling.doctype.lead.lead import _make_customer
 			customer_doclist = _make_customer(lead_name, ignore_permissions=ignore_permissions)
 			customer = webnotes.bean(customer_doclist)
 			customer.ignore_permissions = ignore_permissions
diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py
index 8f0e644..00cbd6c 100644
--- a/erpnext/selling/doctype/quotation/test_quotation.py
+++ b/erpnext/selling/doctype/quotation/test_quotation.py
@@ -9,7 +9,7 @@
 
 class TestQuotation(unittest.TestCase):
 	def test_make_sales_order(self):
-		from selling.doctype.quotation.quotation import make_sales_order
+		from erpnext.selling.doctype.quotation.quotation import make_sales_order
 		
 		quotation = webnotes.bean(copy=test_records[0])
 		quotation.insert()
diff --git a/erpnext/selling/doctype/sales_bom/sales_bom.py b/erpnext/selling/doctype/sales_bom/sales_bom.py
index f6cfafa..2f47be3 100644
--- a/erpnext/selling/doctype/sales_bom/sales_bom.py
+++ b/erpnext/selling/doctype/sales_bom/sales_bom.py
@@ -14,7 +14,7 @@
 	def validate(self):
 		self.validate_main_item()
 
-		from utilities.transaction_base import validate_uom_is_integer
+		from erpnext.utilities.transaction_base import validate_uom_is_integer
 		validate_uom_is_integer(self.doclist, "uom", "qty")
 
 	def validate_main_item(self):
@@ -33,7 +33,7 @@
 		}
 
 def get_new_item_code(doctype, txt, searchfield, start, page_len, filters):
-	from controllers.queries import get_match_cond
+	from erpnext.controllers.queries import get_match_cond
 	
 	return webnotes.conn.sql("""select name, item_name, description from tabItem 
 		where is_stock_item="No" and is_sales_item="Yes"
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index e4b3caf..a8ba502 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -62,7 +62,7 @@
 			cur_frm.add_custom_button(wn._('From Quotation'), 
 				function() {
 					wn.model.map_current_doc({
-						method: "selling.doctype.quotation.quotation.make_sales_order",
+						method: "erpnext.selling.doctype.quotation.quotation.make_sales_order",
 						source_doctype: "Quotation",
 						get_query_filters: {
 							docstatus: 1,
@@ -90,7 +90,7 @@
 		var item = wn.model.get_doc(cdt, cdn);
 		if(item.item_code && item.reserved_warehouse) {
 			return this.frm.call({
-				method: "selling.utils.get_available_qty",
+				method: "erpnext.selling.utils.get_available_qty",
 				child: item,
 				args: {
 					item_code: item.item_code,
@@ -102,35 +102,35 @@
 
 	make_material_request: function() {
 		wn.model.open_mapped_doc({
-			method: "selling.doctype.sales_order.sales_order.make_material_request",
+			method: "erpnext.selling.doctype.sales_order.sales_order.make_material_request",
 			source_name: cur_frm.doc.name
 		})
 	},
 
 	make_delivery_note: function() {
 		wn.model.open_mapped_doc({
-			method: "selling.doctype.sales_order.sales_order.make_delivery_note",
+			method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note",
 			source_name: cur_frm.doc.name
 		})
 	},
 
 	make_sales_invoice: function() {
 		wn.model.open_mapped_doc({
-			method: "selling.doctype.sales_order.sales_order.make_sales_invoice",
+			method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice",
 			source_name: cur_frm.doc.name
 		})
 	},
 	
 	make_maintenance_schedule: function() {
 		wn.model.open_mapped_doc({
-			method: "selling.doctype.sales_order.sales_order.make_maintenance_schedule",
+			method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_schedule",
 			source_name: cur_frm.doc.name
 		})
 	}, 
 	
 	make_maintenance_visit: function() {
 		wn.model.open_mapped_doc({
-			method: "selling.doctype.sales_order.sales_order.make_maintenance_visit",
+			method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_visit",
 			source_name: cur_frm.doc.name
 		})
 	},
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index 771aafa..aa5f214 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -11,7 +11,7 @@
 from webnotes import msgprint
 from webnotes.model.mapper import get_mapped_doclist
 
-from controllers.selling_controller import SellingController
+from erpnext.controllers.selling_controller import SellingController
 
 class DocType(SellingController):
 	def __init__(self, doc, doclist=None):
@@ -111,7 +111,7 @@
 		self.validate_for_items()
 		self.validate_warehouse()
 
-		from stock.doctype.packed_item.packed_item import make_packing_list
+		from erpnext.stock.doctype.packed_item.packed_item import make_packing_list
 		self.doclist = make_packing_list(self,'sales_order_details')
 
 		self.validate_with_previous_doc()
@@ -119,8 +119,8 @@
 		if not self.doc.status:
 			self.doc.status = "Draft"
 
-		import utilities
-		utilities.validate_status(self.doc.status, ["Draft", "Submitted", "Stopped", 
+		from erpnext.utilities import validate_status
+		validate_status(self.doc.status, ["Draft", "Submitted", "Stopped", 
 			"Cancelled"])
 
 		if not self.doc.billing_status: self.doc.billing_status = 'Not Billed'
@@ -128,7 +128,7 @@
 		
 		
 	def validate_warehouse(self):
-		from stock.utils import validate_warehouse_user, validate_warehouse_company
+		from erpnext.stock.utils import validate_warehouse_user, validate_warehouse_company
 		
 		warehouses = list(set([d.reserved_warehouse for d in 
 			self.doclist.get({"doctype": self.tname}) if d.reserved_warehouse]))
@@ -231,7 +231,7 @@
 
 
 	def update_stock_ledger(self, update_stock):
-		from stock.utils import update_bin
+		from erpnext.stock.utils import update_bin
 		for d in self.get_item_list():
 			if webnotes.conn.get_value("Item", d['item_code'], "is_stock_item") == "Yes":
 				args = {
diff --git a/erpnext/selling/doctype/sales_order/templates/pages/order.py b/erpnext/selling/doctype/sales_order/templates/pages/order.py
index d53a8b0..0f996e4 100644
--- a/erpnext/selling/doctype/sales_order/templates/pages/order.py
+++ b/erpnext/selling/doctype/sales_order/templates/pages/order.py
@@ -8,7 +8,7 @@
 no_cache = True
 
 def get_context():
-	from portal.utils import get_transaction_context
+	from erpnext.portal.utils import get_transaction_context
 	context = get_transaction_context("Sales Order", webnotes.form_dict.name)
 	modify_status(context.get("doc"))
 	context.update({
diff --git a/erpnext/selling/doctype/sales_order/templates/pages/orders.py b/erpnext/selling/doctype/sales_order/templates/pages/orders.py
index d7f83dc..ad523fc 100644
--- a/erpnext/selling/doctype/sales_order/templates/pages/orders.py
+++ b/erpnext/selling/doctype/sales_order/templates/pages/orders.py
@@ -7,7 +7,7 @@
 no_cache = True
 
 def get_context():
-	from portal.utils import get_currency_context
+	from erpnext.portal.utils import get_currency_context
 	context = get_currency_context()
 	context.update({
 		"title": "My Orders",
@@ -20,8 +20,8 @@
 	
 @webnotes.whitelist()
 def get_orders(start=0):
-	from portal.utils import get_transaction_list
-	from selling.doctype.sales_order.templates.pages.order import modify_status
+	from erpnext.portal.utils import get_transaction_list
+	from erpnext.selling.doctype.sales_order.templates.pages.order import modify_status
 	orders = get_transaction_list("Sales Order", start, ["per_billed", "per_delivered"])
 	for d in orders:
 		modify_status(d)
diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py
index 1549b24..31c7cbc 100644
--- a/erpnext/selling/doctype/sales_order/test_sales_order.py
+++ b/erpnext/selling/doctype/sales_order/test_sales_order.py
@@ -7,7 +7,7 @@
 
 class TestSalesOrder(unittest.TestCase):
 	def test_make_material_request(self):
-		from selling.doctype.sales_order.sales_order import make_material_request
+		from erpnext.selling.doctype.sales_order.sales_order import make_material_request
 		
 		so = webnotes.bean(copy=test_records[0]).insert()
 		
@@ -22,7 +22,7 @@
 		self.assertEquals(len(mr), len(sales_order.doclist))
 
 	def test_make_delivery_note(self):
-		from selling.doctype.sales_order.sales_order import make_delivery_note
+		from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note
 
 		so = webnotes.bean(copy=test_records[0]).insert()
 
@@ -37,7 +37,7 @@
 		self.assertEquals(len(dn), len(sales_order.doclist))
 
 	def test_make_sales_invoice(self):
-		from selling.doctype.sales_order.sales_order import make_sales_invoice
+		from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice
 
 		so = webnotes.bean(copy=test_records[0]).insert()
 
@@ -71,8 +71,8 @@
 		return w
 		
 	def create_dn_against_so(self, so, delivered_qty=0):
-		from stock.doctype.delivery_note.test_delivery_note import test_records as dn_test_records
-		from stock.doctype.delivery_note.test_delivery_note import _insert_purchase_receipt
+		from erpnext.stock.doctype.delivery_note.test_delivery_note import test_records as dn_test_records
+		from erpnext.stock.doctype.delivery_note.test_delivery_note import _insert_purchase_receipt
 
 		_insert_purchase_receipt(so.doclist[1].item_code)
 		
@@ -164,7 +164,7 @@
 		self.check_reserved_qty(so.doclist[1].item_code, so.doclist[1].reserved_warehouse, 10.0)
 		
 	def test_reserved_qty_for_so_with_packing_list(self):
-		from selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records
+		from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records
 		
 		# change item in test so record
 		test_record = test_records[0][:]
@@ -191,7 +191,7 @@
 			so.doclist[1].reserved_warehouse, 0.0)
 			
 	def test_reserved_qty_for_partial_delivery_with_packing_list(self):
-		from selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records
+		from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records
 		
 		# change item in test so record
 		
@@ -241,7 +241,7 @@
 			so.doclist[1].reserved_warehouse, 20.0)
 			
 	def test_reserved_qty_for_over_delivery_with_packing_list(self):
-		from selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records
+		from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records
 		
 		# change item in test so record
 		test_record = webnotes.copy_doclist(test_records[0])
@@ -284,7 +284,7 @@
 		
 		webnotes.session.user = "test@example.com"
 
-		from stock.utils import UserNotAllowedForWarehouse
+		from erpnext.stock.utils import UserNotAllowedForWarehouse
 		so = webnotes.bean(copy = test_records[0])
 		so.doc.company = "_Test Company 1"
 		so.doc.conversion_rate = 0.02
diff --git a/erpnext/selling/doctype/selling_settings/selling_settings.py b/erpnext/selling/doctype/selling_settings/selling_settings.py
index 0895e3f..c280619 100644
--- a/erpnext/selling/doctype/selling_settings/selling_settings.py
+++ b/erpnext/selling/doctype/selling_settings/selling_settings.py
@@ -15,6 +15,6 @@
 			"editable_price_list_rate", "selling_price_list"]:
 				webnotes.conn.set_default(key, self.doc.fields.get(key, ""))
 
-		from setup.doctype.naming_series.naming_series import set_by_naming_series
+		from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series
 		set_by_naming_series("Customer", "customer_name", 
 			self.doc.get("cust_master_name")=="Naming Series", hide_name_field=False)
diff --git a/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.py
index 6912ac5..923936e 100644
--- a/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.py
+++ b/erpnext/selling/doctype/shopping_cart_settings/shopping_cart_settings.py
@@ -47,7 +47,7 @@
 		
 		# validate that a Shopping Cart Price List exists for the root territory
 		# as a catch all!
-		from setup.utils import get_root_of
+		from erpnext.setup.utils import get_root_of
 		root_territory = get_root_of("Territory")
 		
 		if root_territory not in territory_name_map.keys():
@@ -143,7 +143,7 @@
 		return self.get_name_from_territory(shipping_territory, "shipping_rules", "shipping_rule")
 		
 	def get_territory_ancestry(self, territory):
-		from setup.utils import get_ancestors_of
+		from erpnext.setup.utils import get_ancestors_of
 		
 		if not hasattr(self, "_territory_ancestry"):
 			self._territory_ancestry = {}
diff --git a/erpnext/selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py b/erpnext/selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py
index 6055c61..be67f6f 100644
--- a/erpnext/selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py
+++ b/erpnext/selling/doctype/shopping_cart_settings/test_shopping_cart_settings.py
@@ -6,7 +6,7 @@
 from __future__ import unicode_literals
 import webnotes
 import unittest
-from selling.doctype.shopping_cart_settings.shopping_cart_settings import ShoppingCartSetupError
+from erpnext.selling.doctype.shopping_cart_settings.shopping_cart_settings import ShoppingCartSetupError
 
 class TestShoppingCartSettings(unittest.TestCase):
 	def setUp(self):
@@ -74,7 +74,7 @@
 		controller = cart_settings.make_controller()
 		self.assertRaises(ShoppingCartSetupError, controller.validate_exchange_rates_exist)
 		
-		from setup.doctype.currency_exchange.test_currency_exchange import test_records as \
+		from erpnext.setup.doctype.currency_exchange.test_currency_exchange import test_records as \
 			currency_exchange_records
 		webnotes.bean(currency_exchange_records[0]).insert()
 		controller.validate_exchange_rates_exist()
diff --git a/erpnext/selling/page/sales_browser/sales_browser.js b/erpnext/selling/page/sales_browser/sales_browser.js
index 58a3b1f..1b7d9aa 100644
--- a/erpnext/selling/page/sales_browser/sales_browser.js
+++ b/erpnext/selling/page/sales_browser/sales_browser.js
@@ -22,7 +22,7 @@
 	wrapper.make_tree = function() {
 		var ctype = wn.get_route()[1] || 'Territory';
 		return wn.call({
-			method: 'selling.page.sales_browser.sales_browser.get_children',
+			method: 'erpnext.selling.page.sales_browser.sales_browser.get_children',
 			args: {ctype: ctype},
 			callback: function(r) {
 				var root = r.message[0]["value"];
@@ -60,7 +60,7 @@
 			parent: $(parent), 
 			label: root,
 			args: {ctype: ctype},
-			method: 'selling.page.sales_browser.sales_browser.get_children',
+			method: 'erpnext.selling.page.sales_browser.sales_browser.get_children',
 			click: function(link) {
 				if(me.cur_toolbar) 
 					$(me.cur_toolbar).toggle(false);
@@ -144,7 +144,7 @@
 			v.ctype = me.ctype;
 			
 			return wn.call({
-				method: 'selling.page.sales_browser.sales_browser.add_node',
+				method: 'erpnext.selling.page.sales_browser.sales_browser.add_node',
 				args: v,
 				callback: function() {
 					$(btn).done_working();
diff --git a/erpnext/selling/report/quotation_trends/quotation_trends.py b/erpnext/selling/report/quotation_trends/quotation_trends.py
index f7c023f..ea0d3db 100644
--- a/erpnext/selling/report/quotation_trends/quotation_trends.py
+++ b/erpnext/selling/report/quotation_trends/quotation_trends.py
@@ -3,7 +3,7 @@
 
 from __future__ import unicode_literals
 import webnotes
-from controllers.trends	import get_columns, get_data
+from erpnext.controllers.trends	import get_columns, get_data
 
 def execute(filters=None):
 	if not filters: filters ={}
diff --git a/erpnext/selling/report/sales_order_trends/sales_order_trends.py b/erpnext/selling/report/sales_order_trends/sales_order_trends.py
index d407be0..e9354e6 100644
--- a/erpnext/selling/report/sales_order_trends/sales_order_trends.py
+++ b/erpnext/selling/report/sales_order_trends/sales_order_trends.py
@@ -3,7 +3,7 @@
 
 from __future__ import unicode_literals
 import webnotes
-from controllers.trends	import get_columns,get_data
+from erpnext.controllers.trends	import get_columns,get_data
 
 def execute(filters=None):
 	if not filters: filters ={}
diff --git a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py
index ca18936..3e500dc 100644
--- a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py
+++ b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py
@@ -6,8 +6,8 @@
 from webnotes import _, msgprint
 from webnotes.utils import flt
 import time
-from accounts.utils import get_fiscal_year
-from controllers.trends import get_period_date_ranges, get_period_month_ranges
+from erpnext.accounts.utils import get_fiscal_year
+from erpnext.controllers.trends import get_period_date_ranges, get_period_month_ranges
 from webnotes.model.meta import get_field_precision
 
 def execute(filters=None):
diff --git a/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py b/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py
index 08240a7..d55e210 100644
--- a/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py
+++ b/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py
@@ -6,8 +6,8 @@
 from webnotes import _, msgprint
 from webnotes.utils import flt
 import time
-from accounts.utils import get_fiscal_year
-from controllers.trends import get_period_date_ranges, get_period_month_ranges
+from erpnext.accounts.utils import get_fiscal_year
+from erpnext.controllers.trends import get_period_date_ranges, get_period_month_ranges
 
 def execute(filters=None):
 	if not filters: filters = {}
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index d6c8fdd..c5eb38c 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -158,7 +158,7 @@
 				cur_frm.fields_dict[me.frm.cscript.fname].grid.grid_rows[item.idx - 1].remove();
 			} else {
 				return this.frm.call({
-					method: "selling.utils.get_item_details",
+					method: "erpnext.selling.utils.get_item_details",
 					child: item,
 					args: {
 						args: {
@@ -268,7 +268,7 @@
 		var item = wn.model.get_doc(cdt, cdn);
 		if(item.item_code && item.warehouse) {
 			return this.frm.call({
-				method: "selling.utils.get_available_qty",
+				method: "erpnext.selling.utils.get_available_qty",
 				child: item,
 				args: {
 					item_code: item.item_code,
diff --git a/erpnext/selling/utils/__init__.py b/erpnext/selling/utils/__init__.py
index 5974da7..c73d76e 100644
--- a/erpnext/selling/utils/__init__.py
+++ b/erpnext/selling/utils/__init__.py
@@ -105,7 +105,7 @@
 	return item_code[0]
 	
 def _validate_item_details(args, item):
-	from utilities.transaction_base import validate_item_fetch
+	from erpnext.utilities.transaction_base import validate_item_fetch
 	validate_item_fetch(args, item)
 	
 	# validate if sales item or service item
@@ -154,7 +154,7 @@
 		return {}
 	
 	# found price list rate - now we can validate
-	from utilities.transaction_base import validate_currency
+	from erpnext.utilities.transaction_base import validate_currency
 	validate_currency(args, item_bean.doc, meta)
 	
 	return {"ref_rate": flt(ref_rate[0].ref_rate) * flt(args.plc_conversion_rate) / flt(args.conversion_rate)}
diff --git a/erpnext/selling/utils/cart.py b/erpnext/selling/utils/cart.py
index 3cd7b3c..f23a571 100644
--- a/erpnext/selling/utils/cart.py
+++ b/erpnext/selling/utils/cart.py
@@ -2,7 +2,7 @@
 # License: GNU General Public License v3. See license.txt
 
 from __future__ import unicode_literals
-import webnotes
+import webnotes, json
 from webnotes import msgprint, _
 import webnotes.defaults
 from webnotes.utils import flt, get_fullname, fmt_money, cstr
@@ -42,7 +42,7 @@
 	quotation.ignore_permissions = True
 	quotation.submit()
 	
-	from selling.doctype.quotation.quotation import _make_sales_order
+	from erpnext.selling.doctype.quotation.quotation import _make_sales_order
 	sales_order = webnotes.bean(_make_sales_order(quotation.doc.name, ignore_permissions=True))
 	sales_order.ignore_permissions = True
 	sales_order.insert()
@@ -92,7 +92,7 @@
 		
 @webnotes.whitelist()
 def update_cart_address(address_fieldname, address_name):
-	from utilities.transaction_base import get_address_display
+	from erpnext.utilities.transaction_base import get_address_display
 	
 	quotation = _get_cart_quotation()
 	address_display = get_address_display(webnotes.doc("Address", address_name).fields)
@@ -123,7 +123,7 @@
 @webnotes.whitelist()
 def save_address(fields, address_fieldname=None):
 	party = get_lead_or_customer()
-	fields = webnotes.load_json(fields)
+	fields = json.loads(fields)
 	
 	if fields.get("name"):
 		bean = webnotes.bean("Address", fields.get("name"))
@@ -147,7 +147,7 @@
 	
 def get_address_docs(party=None):
 	from webnotes.model.doclist import objectify
-	from utilities.transaction_base import get_address_display
+	from erpnext.utilities.transaction_base import get_address_display
 	
 	if not party:
 		party = get_lead_or_customer()
diff --git a/erpnext/selling/utils/product.py b/erpnext/selling/utils/product.py
index 32ff85a..a976e2a 100644
--- a/erpnext/selling/utils/product.py
+++ b/erpnext/selling/utils/product.py
@@ -6,7 +6,7 @@
 import webnotes
 from webnotes.utils import cstr, cint, fmt_money, get_base_path
 from webnotes.webutils import delete_page_cache
-from selling.utils.cart import _get_cart_quotation
+from erpnext.selling.utils.cart import _get_cart_quotation
 
 @webnotes.whitelist(allow_guest=True)
 def get_product_info(item_code):