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 f8ca76980fd..00000000000
--- 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/templates/__init__.py b/erpnext/portal/templates/__init__.py
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/erpnext/portal/templates/base.html b/erpnext/portal/templates/base.html
deleted file mode 100644
index 3eb7adca8e0..00000000000
--- 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/portal/templates/pages/__init__.py b/erpnext/portal/templates/pages/__init__.py
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/erpnext/selling/doctype/sales_order/templates/pages/order.html b/erpnext/selling/doctype/sales_order/templates/pages/order.html
index 44c53308493..45867eabdf5 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 0f996e41839..e172c095078 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 @@ from webnotes import _
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 f8ca76980fd..0467f34ae62 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 ad523fca70d..5d28d5bf6da 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 @@ import webnotes
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 @@ def get_context():
@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 a976e2a647d..dda56e52e16 100644
--- a/erpnext/selling/utils/product.py
+++ b/erpnext/selling/utils/product.py
@@ -107,11 +107,7 @@ def get_group_item_count(item_group):
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 e69de29bb2d..00000000000
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 e69de29bb2d..00000000000
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 e69de29bb2d..00000000000
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 e69de29bb2d..00000000000
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 fafa03bd5ec..00000000000
--- 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 f8ca76980fd..00000000000
--- 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/generators/__init__.py b/erpnext/stock/doctype/item/templates/generators/__init__.py
deleted file mode 100644
index e69de29bb2d..00000000000
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 e69de29bb2d..00000000000
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 e69de29bb2d..00000000000
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 e69de29bb2d..00000000000
diff --git a/erpnext/accounts/doctype/sales_invoice/templates/__init__.py b/erpnext/templates/__init__.py
similarity index 100%
rename from erpnext/accounts/doctype/sales_invoice/templates/__init__.py
rename to erpnext/templates/__init__.py
diff --git a/erpnext/accounts/doctype/sales_invoice/templates/pages/__init__.py b/erpnext/templates/generators/__init__.py
similarity index 100%
rename from erpnext/accounts/doctype/sales_invoice/templates/pages/__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 141982bbba4..91ea3e49172 100644
--- a/erpnext/stock/doctype/item/templates/generators/item.html
+++ b/erpnext/templates/generators/item.html
@@ -2,12 +2,12 @@
{% block javascript %}
-{% endblock %}
diff --git a/erpnext/templates/includes/footer_powered.html b/erpnext/templates/includes/footer_powered.html
new file mode 100644
index 00000000000..0abf2e4e778
--- /dev/null
+++ b/erpnext/templates/includes/footer_powered.html
@@ -0,0 +1 @@
+ERPNext Powered
\ 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/__init__.py b/erpnext/templates/pages/__init__.py
similarity index 100%
rename from erpnext/portal/__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 95%
rename from erpnext/portal/templates/pages/cart.html
rename to erpnext/templates/pages/cart.html
index db812299f3f..8aae9d92b94 100644
--- a/erpnext/portal/templates/pages/cart.html
+++ b/erpnext/templates/pages/cart.html
@@ -1,7 +1,7 @@
{% extends base_template %}
{% block javascript %}
-
+
{% 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 54%
rename from erpnext/accounts/doctype/sales_invoice/templates/pages/invoice.html
rename to erpnext/templates/pages/invoice.html
index 44c53308493..45867eabdf5 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 2002d14fe40..9d6a558b7c1 100644
--- a/erpnext/accounts/doctype/sales_invoice/templates/pages/invoice.py
+++ b/erpnext/templates/pages/invoice.py
@@ -9,7 +9,7 @@ from webnotes.utils import flt, fmt_money
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 00000000000..0467f34ae62
--- /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 85%
rename from erpnext/accounts/doctype/sales_invoice/templates/pages/invoices.py
rename to erpnext/templates/pages/invoices.py
index 7c2e4ed9fc7..448c525068d 100644
--- a/erpnext/accounts/doctype/sales_invoice/templates/pages/invoices.py
+++ b/erpnext/templates/pages/invoices.py
@@ -7,7 +7,7 @@ import webnotes
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 @@ def get_context():
@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 95%
rename from erpnext/portal/templates/pages/profile.html
rename to erpnext/templates/pages/profile.html
index a8077319c1f..880b8d49e3c 100644
--- a/erpnext/portal/templates/pages/profile.html
+++ b/erpnext/templates/pages/profile.html
@@ -34,7 +34,7 @@ $(document).ready(function() {
$("#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 00000000000..d0aaa3efd59
--- /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 83%
rename from erpnext/stock/doctype/delivery_note/templates/pages/shipment.py
rename to erpnext/templates/pages/shipment.py
index dc8ab6af6a7..e7446852107 100644
--- a/erpnext/stock/doctype/delivery_note/templates/pages/shipment.py
+++ b/erpnext/templates/pages/shipment.py
@@ -7,7 +7,7 @@ import webnotes
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 00000000000..0467f34ae62
--- /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 8c20149f00c..03d074a19fa 100644
--- a/erpnext/stock/doctype/delivery_note/templates/pages/shipments.py
+++ b/erpnext/templates/pages/shipments.py
@@ -7,11 +7,11 @@ import webnotes
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 @@ def get_context():
@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 549c227981b..6942d3bff03 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 92%
rename from erpnext/portal/templates/sales_transactions.html
rename to erpnext/templates/sales_transactions.html
index 632793c85a1..4836c12dca5 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 -%}