Redesigned templates. Now all templates must be inside templates/pages templates/generators
diff --git a/erpnext/accounts/doctype/sales_invoice/templates/__init__.py b/erpnext/accounts/doctype/sales_invoice/templates/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/accounts/doctype/sales_invoice/templates/__init__.py
+++ /dev/null
diff --git a/erpnext/accounts/doctype/sales_invoice/templates/pages/__init__.py b/erpnext/accounts/doctype/sales_invoice/templates/pages/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/accounts/doctype/sales_invoice/templates/pages/__init__.py
+++ /dev/null
diff --git a/erpnext/accounts/doctype/sales_invoice/templates/pages/invoices.html b/erpnext/accounts/doctype/sales_invoice/templates/pages/invoices.html
deleted file mode 100644
index f8ca769..0000000
--- a/erpnext/accounts/doctype/sales_invoice/templates/pages/invoices.html
+++ /dev/null
@@ -1 +0,0 @@
-{% extends "portal/templates/sales_transactions.html" %}
\ No newline at end of file
diff --git a/erpnext/portal/__init__.py b/erpnext/portal/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/portal/__init__.py
+++ /dev/null
diff --git a/erpnext/portal/templates/base.html b/erpnext/portal/templates/base.html
deleted file mode 100644
index 3eb7adc..0000000
--- a/erpnext/portal/templates/base.html
+++ /dev/null
@@ -1,3 +0,0 @@
-{% extends "website/templates/base.html" %}
-
-{% block footer %}{% include "portal/templates/includes/footer.html" %}{% endblock %}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/templates/pages/order.html b/erpnext/selling/doctype/sales_order/templates/pages/order.html
index 44c5330..45867ea 100644
--- a/erpnext/selling/doctype/sales_order/templates/pages/order.html
+++ b/erpnext/selling/doctype/sales_order/templates/pages/order.html
@@ -1,4 +1,4 @@
-{% extends "portal/templates/sale.html" %}
+{% extends "templates/sale.html" %}
 
 {% block status -%}
 	{% if doc.status %}{{ doc.status }}{% endif %}
diff --git a/erpnext/selling/doctype/sales_order/templates/pages/order.py b/erpnext/selling/doctype/sales_order/templates/pages/order.py
index 0f996e4..e172c09 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 erpnext.portal.utils import get_transaction_context
+	from erpnext.templates.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.html b/erpnext/selling/doctype/sales_order/templates/pages/orders.html
index f8ca769..0467f34 100644
--- a/erpnext/selling/doctype/sales_order/templates/pages/orders.html
+++ b/erpnext/selling/doctype/sales_order/templates/pages/orders.html
@@ -1 +1 @@
-{% extends "portal/templates/sales_transactions.html" %}
\ No newline at end of file
+{% extends "templates/sales_transactions.html" %}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/templates/pages/orders.py b/erpnext/selling/doctype/sales_order/templates/pages/orders.py
index ad523fc..5d28d5b 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 erpnext.portal.utils import get_currency_context
+	from erpnext.templates.utils import get_currency_context
 	context = get_currency_context()
 	context.update({
 		"title": "My Orders",
@@ -20,7 +20,7 @@
 	
 @webnotes.whitelist()
 def get_orders(start=0):
-	from erpnext.portal.utils import get_transaction_list
+	from erpnext.templates.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:
diff --git a/erpnext/selling/utils/product.py b/erpnext/selling/utils/product.py
index a976e2a..dda56e5 100644
--- a/erpnext/selling/utils/product.py
+++ b/erpnext/selling/utils/product.py
@@ -107,11 +107,7 @@
 				where item_group in (%s))) """ % (child_groups, child_groups))[0][0]
 
 def get_item_for_list_in_html(context):
-	from jinja2 import Environment, FileSystemLoader
-	scrub_item_for_list(context)
-	jenv = Environment(loader = FileSystemLoader(get_base_path()))
-	template = jenv.get_template("app/stock/doctype/item/templates/includes/product_in_grid.html")
-	return template.render(context)
+	return webnotes.get_template("templates/includes/product_in_grid.html").render(context)
 
 def scrub_item_for_list(r):
 	if not r.website_description:
diff --git a/erpnext/setup/doctype/item_group/templates/__init__.py b/erpnext/setup/doctype/item_group/templates/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/setup/doctype/item_group/templates/__init__.py
+++ /dev/null
diff --git a/erpnext/setup/doctype/item_group/templates/generators/__init__.py b/erpnext/setup/doctype/item_group/templates/generators/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/setup/doctype/item_group/templates/generators/__init__.py
+++ /dev/null
diff --git a/erpnext/stock/doctype/delivery_note/templates/__init__.py b/erpnext/stock/doctype/delivery_note/templates/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/stock/doctype/delivery_note/templates/__init__.py
+++ /dev/null
diff --git a/erpnext/stock/doctype/delivery_note/templates/pages/__init__.py b/erpnext/stock/doctype/delivery_note/templates/pages/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/stock/doctype/delivery_note/templates/pages/__init__.py
+++ /dev/null
diff --git a/erpnext/stock/doctype/delivery_note/templates/pages/shipment.html b/erpnext/stock/doctype/delivery_note/templates/pages/shipment.html
deleted file mode 100644
index fafa03b..0000000
--- a/erpnext/stock/doctype/delivery_note/templates/pages/shipment.html
+++ /dev/null
@@ -1 +0,0 @@
-{% extends "portal/templates/sale.html" %}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/delivery_note/templates/pages/shipments.html b/erpnext/stock/doctype/delivery_note/templates/pages/shipments.html
deleted file mode 100644
index f8ca769..0000000
--- a/erpnext/stock/doctype/delivery_note/templates/pages/shipments.html
+++ /dev/null
@@ -1 +0,0 @@
-{% extends "portal/templates/sales_transactions.html" %}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/templates/pages/__init__.py b/erpnext/stock/doctype/item/templates/pages/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/stock/doctype/item/templates/pages/__init__.py
+++ /dev/null
diff --git a/erpnext/support/doctype/support_ticket/templates/__init__.py b/erpnext/support/doctype/support_ticket/templates/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/support/doctype/support_ticket/templates/__init__.py
+++ /dev/null
diff --git a/erpnext/support/doctype/support_ticket/templates/pages/__init__.py b/erpnext/support/doctype/support_ticket/templates/pages/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/support/doctype/support_ticket/templates/pages/__init__.py
+++ /dev/null
diff --git a/erpnext/portal/templates/__init__.py b/erpnext/templates/__init__.py
similarity index 100%
rename from erpnext/portal/templates/__init__.py
rename to erpnext/templates/__init__.py
diff --git a/erpnext/stock/doctype/item/templates/generators/__init__.py b/erpnext/templates/generators/__init__.py
similarity index 100%
rename from erpnext/stock/doctype/item/templates/generators/__init__.py
rename to erpnext/templates/generators/__init__.py
diff --git a/erpnext/stock/doctype/item/templates/generators/item.html b/erpnext/templates/generators/item.html
similarity index 81%
rename from erpnext/stock/doctype/item/templates/generators/item.html
rename to erpnext/templates/generators/item.html
index 141982b..91ea3e4 100644
--- a/erpnext/stock/doctype/item/templates/generators/item.html
+++ b/erpnext/templates/generators/item.html
@@ -2,12 +2,12 @@
 
 {% block javascript %}
 <script>
-	{% include "stock/doctype/item/templates/includes/product_page.js" %}
+	{% include "templates/includes/product_page.js" %}
 	
 	$(function() {
 		if(window.logged_in && getCookie("system_user")==="yes") {
 			wn.has_permission("Item", "{{ name }}", "write", function(r) {
-				wn.require("js/wn/website/editable.js");
+				wn.require("assets/webnotes/js/wn/website/editable.js");
 				wn.make_editable($('[itemprop="description"]'), "Item", "{{ name }}", "web_long_description");
 			});
 		}
@@ -17,25 +17,25 @@
 
 {% block css %}
 <style>
-	{% include "stock/doctype/item/templates/includes/product_page.css" %}
+	{% include "templates/includes/product_page.css" %}
 </style>
 {% endblock %}
 
 {% block content %}
-	{% include 'stock/doctype/item/templates/includes/product_search_box.html' %}
-	{% include 'stock/doctype/item/templates/includes/product_breadcrumbs.html' %}
+	{% include 'templates/includes/product_search_box.html' %}
+	{% include 'templates/includes/product_breadcrumbs.html' %}
 	<div class="container content product-page-content" itemscope itemtype="http://schema.org/Product">
 		<div class="row">
 			<div class="col-md-6">
 				{% if slideshow %}
-					{% include "website/doctype/website_slideshow/templates/includes/slideshow.html" %}
+					{% include "templates/includes/slideshow.html" %}
 				{% else %}
 					{% if website_image %}
 					<image itemprop="image" class="item-main-image"
 						src="{{ website_image }}" />
 					{% else %}
 					<div class="img-area">
-		{% include 'stock/doctype/item/templates/includes/product_missing_image.html' %}
+		{% include 'templates/includes/product_missing_image.html' %}
 					</div>
 					{% endif %}
 				{% endif %}
diff --git a/erpnext/stock/doctype/item/templates/generators/item.py b/erpnext/templates/generators/item.py
similarity index 100%
rename from erpnext/stock/doctype/item/templates/generators/item.py
rename to erpnext/templates/generators/item.py
diff --git a/erpnext/setup/doctype/item_group/templates/generators/item_group.html b/erpnext/templates/generators/item_group.html
similarity index 79%
rename from erpnext/setup/doctype/item_group/templates/generators/item_group.html
rename to erpnext/templates/generators/item_group.html
index f021916..c5fcd90 100644
--- a/erpnext/setup/doctype/item_group/templates/generators/item_group.html
+++ b/erpnext/templates/generators/item_group.html
@@ -1,11 +1,11 @@
 {% extends base_template %}
 
 {% block content %}
-{% include 'stock/doctype/item/templates/includes/product_search_box.html' %}
-{% include 'stock/doctype/item/templates/includes/product_breadcrumbs.html' %}
+{% include 'templates/includes/product_search_box.html' %}
+{% include 'templates/includes/product_breadcrumbs.html' %}
 <div class="container content">
 	{% if slideshow %}<!-- slideshow -->
-	{% include "website/doctype/website_slideshow/templates/includes/slideshow.html" %}
+	{% include "templates/includes/slideshow.html" %}
 	{% endif %}
 	{% if description %}<!-- description -->
 	<div itemprop="description">{{ description or ""}}</div>
@@ -42,7 +42,7 @@
 $(function() {
 	if(window.logged_in && getCookie("system_user")==="yes") {
 		wn.has_permission("Item Group", "{{ name }}", "write", function(r) {
-			wn.require("js/wn/website/editable.js");
+			wn.require("assets/webnotes/js/wn/website/editable.js");
 			wn.make_editable($('[itemprop="description"]'), "Item Group", "{{ name }}", "description");
 		});
 	}
diff --git a/erpnext/setup/doctype/item_group/templates/generators/item_group.py b/erpnext/templates/generators/item_group.py
similarity index 100%
rename from erpnext/setup/doctype/item_group/templates/generators/item_group.py
rename to erpnext/templates/generators/item_group.py
diff --git a/erpnext/portal/templates/includes/cart.js b/erpnext/templates/includes/cart.js
similarity index 100%
rename from erpnext/portal/templates/includes/cart.js
rename to erpnext/templates/includes/cart.js
diff --git a/erpnext/portal/templates/includes/footer.html b/erpnext/templates/includes/footer_extension.html
similarity index 85%
rename from erpnext/portal/templates/includes/footer.html
rename to erpnext/templates/includes/footer_extension.html
index 9912c9c..51367e1 100644
--- a/erpnext/portal/templates/includes/footer.html
+++ b/erpnext/templates/includes/footer_extension.html
@@ -1,8 +1,3 @@
-{% extends "website/templates/includes/footer.html" %}
-
-{% block powered %}<a href="http://erpnext.org" style="color: #aaa;">ERPNext Powered</a>{% endblock %}
-
-{% block extension %}
 <div class="container">
 	<div class="row">
 		<div class="input-group col-sm-6 col-sm-offset-3" style="margin-top: 7px;">
@@ -39,4 +34,3 @@
 		}
 	});
 </script>
-{% endblock %}
diff --git a/erpnext/templates/includes/footer_powered.html b/erpnext/templates/includes/footer_powered.html
new file mode 100644
index 0000000..0abf2e4
--- /dev/null
+++ b/erpnext/templates/includes/footer_powered.html
@@ -0,0 +1 @@
+<a href="http://erpnext.org" style="color: #aaa;">ERPNext Powered</a>
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/templates/includes/product_breadcrumbs.html b/erpnext/templates/includes/product_breadcrumbs.html
similarity index 100%
rename from erpnext/stock/doctype/item/templates/includes/product_breadcrumbs.html
rename to erpnext/templates/includes/product_breadcrumbs.html
diff --git a/erpnext/stock/doctype/item/templates/includes/product_in_grid.html b/erpnext/templates/includes/product_in_grid.html
similarity index 100%
rename from erpnext/stock/doctype/item/templates/includes/product_in_grid.html
rename to erpnext/templates/includes/product_in_grid.html
diff --git a/erpnext/stock/doctype/item/templates/includes/product_in_list.html b/erpnext/templates/includes/product_in_list.html
similarity index 100%
rename from erpnext/stock/doctype/item/templates/includes/product_in_list.html
rename to erpnext/templates/includes/product_in_list.html
diff --git a/erpnext/stock/doctype/item/templates/includes/product_list.js b/erpnext/templates/includes/product_list.js
similarity index 100%
rename from erpnext/stock/doctype/item/templates/includes/product_list.js
rename to erpnext/templates/includes/product_list.js
diff --git a/erpnext/stock/doctype/item/templates/includes/product_missing_image.html b/erpnext/templates/includes/product_missing_image.html
similarity index 100%
rename from erpnext/stock/doctype/item/templates/includes/product_missing_image.html
rename to erpnext/templates/includes/product_missing_image.html
diff --git a/erpnext/stock/doctype/item/templates/includes/product_page.css b/erpnext/templates/includes/product_page.css
similarity index 100%
rename from erpnext/stock/doctype/item/templates/includes/product_page.css
rename to erpnext/templates/includes/product_page.css
diff --git a/erpnext/stock/doctype/item/templates/includes/product_page.js b/erpnext/templates/includes/product_page.js
similarity index 100%
rename from erpnext/stock/doctype/item/templates/includes/product_page.js
rename to erpnext/templates/includes/product_page.js
diff --git a/erpnext/stock/doctype/item/templates/includes/product_search_box.html b/erpnext/templates/includes/product_search_box.html
similarity index 100%
rename from erpnext/stock/doctype/item/templates/includes/product_search_box.html
rename to erpnext/templates/includes/product_search_box.html
diff --git a/erpnext/portal/templates/includes/transactions.html b/erpnext/templates/includes/transactions.html
similarity index 100%
rename from erpnext/portal/templates/includes/transactions.html
rename to erpnext/templates/includes/transactions.html
diff --git a/erpnext/portal/templates/pages/__init__.py b/erpnext/templates/pages/__init__.py
similarity index 100%
rename from erpnext/portal/templates/pages/__init__.py
rename to erpnext/templates/pages/__init__.py
diff --git a/erpnext/utilities/doctype/address/templates/pages/address.html b/erpnext/templates/pages/address.html
similarity index 100%
rename from erpnext/utilities/doctype/address/templates/pages/address.html
rename to erpnext/templates/pages/address.html
diff --git a/erpnext/utilities/doctype/address/templates/pages/address.py b/erpnext/templates/pages/address.py
similarity index 100%
rename from erpnext/utilities/doctype/address/templates/pages/address.py
rename to erpnext/templates/pages/address.py
diff --git a/erpnext/utilities/doctype/address/templates/pages/addresses.html b/erpnext/templates/pages/addresses.html
similarity index 100%
rename from erpnext/utilities/doctype/address/templates/pages/addresses.html
rename to erpnext/templates/pages/addresses.html
diff --git a/erpnext/utilities/doctype/address/templates/pages/addresses.py b/erpnext/templates/pages/addresses.py
similarity index 100%
rename from erpnext/utilities/doctype/address/templates/pages/addresses.py
rename to erpnext/templates/pages/addresses.py
diff --git a/erpnext/portal/templates/pages/cart.html b/erpnext/templates/pages/cart.html
similarity index 96%
rename from erpnext/portal/templates/pages/cart.html
rename to erpnext/templates/pages/cart.html
index db81229..8aae9d9 100644
--- a/erpnext/portal/templates/pages/cart.html
+++ b/erpnext/templates/pages/cart.html
@@ -1,7 +1,7 @@
 {% extends base_template %}
 
 {% block javascript %}
-<script>{% include "portal/templates/includes/cart.js" %}</script>
+<script>{% include "templates/includes/cart.js" %}</script>
 {% endblock %}
 
 {% set title="Shopping Cart" %}
diff --git a/erpnext/portal/templates/pages/cart.py b/erpnext/templates/pages/cart.py
similarity index 100%
rename from erpnext/portal/templates/pages/cart.py
rename to erpnext/templates/pages/cart.py
diff --git a/erpnext/accounts/doctype/sales_invoice/templates/pages/invoice.html b/erpnext/templates/pages/invoice.html
similarity index 66%
rename from erpnext/accounts/doctype/sales_invoice/templates/pages/invoice.html
rename to erpnext/templates/pages/invoice.html
index 44c5330..45867ea 100644
--- a/erpnext/accounts/doctype/sales_invoice/templates/pages/invoice.html
+++ b/erpnext/templates/pages/invoice.html
@@ -1,4 +1,4 @@
-{% extends "portal/templates/sale.html" %}
+{% extends "templates/sale.html" %}
 
 {% block status -%}
 	{% if doc.status %}{{ doc.status }}{% endif %}
diff --git a/erpnext/accounts/doctype/sales_invoice/templates/pages/invoice.py b/erpnext/templates/pages/invoice.py
similarity index 93%
rename from erpnext/accounts/doctype/sales_invoice/templates/pages/invoice.py
rename to erpnext/templates/pages/invoice.py
index 2002d14..9d6a558 100644
--- a/erpnext/accounts/doctype/sales_invoice/templates/pages/invoice.py
+++ b/erpnext/templates/pages/invoice.py
@@ -9,7 +9,7 @@
 no_cache = True
 
 def get_context():
-	from erpnext.portal.utils import get_transaction_context
+	from erpnext.templates.utils import get_transaction_context
 	context = get_transaction_context("Sales Invoice", webnotes.form_dict.name)
 	modify_status(context.get("doc"))
 	context.update({
diff --git a/erpnext/templates/pages/invoices.html b/erpnext/templates/pages/invoices.html
new file mode 100644
index 0000000..0467f34
--- /dev/null
+++ b/erpnext/templates/pages/invoices.html
@@ -0,0 +1 @@
+{% extends "templates/sales_transactions.html" %}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/templates/pages/invoices.py b/erpnext/templates/pages/invoices.py
similarity index 86%
rename from erpnext/accounts/doctype/sales_invoice/templates/pages/invoices.py
rename to erpnext/templates/pages/invoices.py
index 7c2e4ed..448c525 100644
--- a/erpnext/accounts/doctype/sales_invoice/templates/pages/invoices.py
+++ b/erpnext/templates/pages/invoices.py
@@ -7,7 +7,7 @@
 no_cache = True
 
 def get_context():
-	from erpnext.portal.utils import get_currency_context
+	from erpnext.templates.utils import get_currency_context
 	context = get_currency_context()
 	context.update({
 		"title": "Invoices",
@@ -20,7 +20,7 @@
 	
 @webnotes.whitelist()
 def get_invoices(start=0):
-	from erpnext.portal.utils import get_transaction_list
+	from erpnext.templates.utils import get_transaction_list
 	from erpnext.accounts.doctype.sales_invoice.templates.pages.invoice import modify_status
 	invoices = get_transaction_list("Sales Invoice", start, ["outstanding_amount"])
 	for d in invoices:
diff --git a/erpnext/stock/doctype/item/templates/pages/product_search.html b/erpnext/templates/pages/product_search.html
similarity index 100%
rename from erpnext/stock/doctype/item/templates/pages/product_search.html
rename to erpnext/templates/pages/product_search.html
diff --git a/erpnext/stock/doctype/item/templates/pages/product_search.py b/erpnext/templates/pages/product_search.py
similarity index 100%
rename from erpnext/stock/doctype/item/templates/pages/product_search.py
rename to erpnext/templates/pages/product_search.py
diff --git a/erpnext/portal/templates/pages/profile.html b/erpnext/templates/pages/profile.html
similarity index 96%
rename from erpnext/portal/templates/pages/profile.html
rename to erpnext/templates/pages/profile.html
index a807731..880b8d4 100644
--- a/erpnext/portal/templates/pages/profile.html
+++ b/erpnext/templates/pages/profile.html
@@ -34,7 +34,7 @@
 	$("#fullname").val(getCookie("full_name") || "");
 	$("#update_profile").click(function() {
 		wn.call({
-			method: "portal.templates.pages.profile.update_profile",
+			method: "erpnext.templates.pages.profile.update_profile",
 			type: "POST",
 			args: {
 				fullname: $("#fullname").val(),
diff --git a/erpnext/portal/templates/pages/profile.py b/erpnext/templates/pages/profile.py
similarity index 100%
rename from erpnext/portal/templates/pages/profile.py
rename to erpnext/templates/pages/profile.py
diff --git a/erpnext/templates/pages/shipment.html b/erpnext/templates/pages/shipment.html
new file mode 100644
index 0000000..d0aaa3e
--- /dev/null
+++ b/erpnext/templates/pages/shipment.html
@@ -0,0 +1 @@
+{% extends "templates/sale.html" %}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/delivery_note/templates/pages/shipment.py b/erpnext/templates/pages/shipment.py
similarity index 86%
rename from erpnext/stock/doctype/delivery_note/templates/pages/shipment.py
rename to erpnext/templates/pages/shipment.py
index dc8ab6a..e744685 100644
--- a/erpnext/stock/doctype/delivery_note/templates/pages/shipment.py
+++ b/erpnext/templates/pages/shipment.py
@@ -7,7 +7,7 @@
 no_cache = True
 
 def get_context():
-	from erpnext.portal.utils import get_transaction_context
+	from erpnext.templates.utils import get_transaction_context
 	context = get_transaction_context("Delivery Note", webnotes.form_dict.name)
 	context.update({
 		"parent_link": "shipments",
diff --git a/erpnext/templates/pages/shipments.html b/erpnext/templates/pages/shipments.html
new file mode 100644
index 0000000..0467f34
--- /dev/null
+++ b/erpnext/templates/pages/shipments.html
@@ -0,0 +1 @@
+{% extends "templates/sales_transactions.html" %}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/delivery_note/templates/pages/shipments.py b/erpnext/templates/pages/shipments.py
similarity index 74%
rename from erpnext/stock/doctype/delivery_note/templates/pages/shipments.py
rename to erpnext/templates/pages/shipments.py
index 8c20149..03d074a 100644
--- a/erpnext/stock/doctype/delivery_note/templates/pages/shipments.py
+++ b/erpnext/templates/pages/shipments.py
@@ -7,11 +7,11 @@
 no_cache = True
 
 def get_context():
-	from erpnext.portal.utils import get_currency_context
+	from erpnext.templates.utils import get_currency_context
 	context = get_currency_context()
 	context.update({
 		"title": "Shipments",
-		"method": "portal.templates.pages.shipments.get_shipments",
+		"method": "erpnext.templates.pages.shipments.get_shipments",
 		"icon": "icon-truck",
 		"empty_list_message": "No Shipments Found",
 		"page": "shipment"
@@ -20,5 +20,5 @@
 	
 @webnotes.whitelist()
 def get_shipments(start=0):
-	from erpnext.portal.utils import get_transaction_list
+	from erpnext.templates.utils import get_transaction_list
 	return get_transaction_list("Delivery Note", start)
diff --git a/erpnext/support/doctype/support_ticket/templates/pages/ticket.html b/erpnext/templates/pages/ticket.html
similarity index 100%
rename from erpnext/support/doctype/support_ticket/templates/pages/ticket.html
rename to erpnext/templates/pages/ticket.html
diff --git a/erpnext/support/doctype/support_ticket/templates/pages/ticket.py b/erpnext/templates/pages/ticket.py
similarity index 100%
rename from erpnext/support/doctype/support_ticket/templates/pages/ticket.py
rename to erpnext/templates/pages/ticket.py
diff --git a/erpnext/support/doctype/support_ticket/templates/pages/tickets.html b/erpnext/templates/pages/tickets.html
similarity index 97%
rename from erpnext/support/doctype/support_ticket/templates/pages/tickets.html
rename to erpnext/templates/pages/tickets.html
index 549c227..6942d3b 100644
--- a/erpnext/support/doctype/support_ticket/templates/pages/tickets.html
+++ b/erpnext/templates/pages/tickets.html
@@ -1,4 +1,4 @@
-{% extends "portal/templates/includes/transactions.html" %}
+{% extends "templates/includes/transactions.html" %}
 
 {% block javascript -%}
 {{ super() }}
diff --git a/erpnext/support/doctype/support_ticket/templates/pages/tickets.py b/erpnext/templates/pages/tickets.py
similarity index 100%
rename from erpnext/support/doctype/support_ticket/templates/pages/tickets.py
rename to erpnext/templates/pages/tickets.py
diff --git a/erpnext/portal/templates/sale.html b/erpnext/templates/sale.html
similarity index 100%
rename from erpnext/portal/templates/sale.html
rename to erpnext/templates/sale.html
diff --git a/erpnext/portal/templates/sales_transactions.html b/erpnext/templates/sales_transactions.html
similarity index 93%
rename from erpnext/portal/templates/sales_transactions.html
rename to erpnext/templates/sales_transactions.html
index 632793c..4836c12 100644
--- a/erpnext/portal/templates/sales_transactions.html
+++ b/erpnext/templates/sales_transactions.html
@@ -1,4 +1,4 @@
-{% extends "portal/templates/includes/transactions.html" %}
+{% extends "templates/includes/transactions.html" %}
 
 {% block javascript -%}
 <script>
diff --git a/erpnext/portal/utils.py b/erpnext/templates/utils.py
similarity index 100%
rename from erpnext/portal/utils.py
rename to erpnext/templates/utils.py
diff --git a/erpnext/utilities/demo/demo_control_panel.py b/erpnext/utilities/demo/demo_control_panel.py
index 694f7d1..cb80373 100644
--- a/erpnext/utilities/demo/demo_control_panel.py
+++ b/erpnext/utilities/demo/demo_control_panel.py
@@ -9,7 +9,7 @@
 			if webnotes.form_dict.lead_email and validate_email_add(webnotes.form_dict.lead_email):
 				import requests
 				response = requests.post(conf.demo_notify_url, data={
-					"cmd":"portal.utils.send_message",
+					"cmd":"erpnext.templates.utils.send_message",
 					"subject":"Logged into Demo",
 					"sender": webnotes.form_dict.lead_email,
 					"message": "via demo.erpnext.com"
diff --git a/erpnext/utilities/doctype/address/templates/__init__.py b/erpnext/utilities/doctype/address/templates/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/utilities/doctype/address/templates/__init__.py
+++ /dev/null
diff --git a/erpnext/utilities/doctype/address/templates/pages/__init__.py b/erpnext/utilities/doctype/address/templates/pages/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/utilities/doctype/address/templates/pages/__init__.py
+++ /dev/null