diff --git a/accounts/doctype/sales_invoice/sales_invoice.py b/accounts/doctype/sales_invoice/sales_invoice.py index 17ae216e02..879ccaf441 100644 --- a/accounts/doctype/sales_invoice/sales_invoice.py +++ b/accounts/doctype/sales_invoice/sales_invoice.py @@ -148,6 +148,9 @@ class DocType(SellingController): self.validate_recurring_invoice() self.convert_to_recurring() + def get_portal_page(self): + return "invoice" if self.doc.docstatus==1 else None + def set_missing_values(self, for_validate=False): self.set_pos_fields(for_validate) diff --git a/accounts/doctype/sales_invoice/templates/__init__.py b/accounts/doctype/sales_invoice/templates/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/accounts/doctype/sales_invoice/templates/pages/__init__.py b/accounts/doctype/sales_invoice/templates/pages/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/portal/templates/pages/invoice.html b/accounts/doctype/sales_invoice/templates/pages/invoice.html similarity index 100% rename from portal/templates/pages/invoice.html rename to accounts/doctype/sales_invoice/templates/pages/invoice.html diff --git a/portal/templates/pages/invoice.py b/accounts/doctype/sales_invoice/templates/pages/invoice.py similarity index 96% rename from portal/templates/pages/invoice.py rename to accounts/doctype/sales_invoice/templates/pages/invoice.py index ed6e40a6e5..7196a3039b 100644 --- a/portal/templates/pages/invoice.py +++ b/accounts/doctype/sales_invoice/templates/pages/invoice.py @@ -4,6 +4,8 @@ from __future__ import unicode_literals import webnotes +no_cache = True + def get_context(): from portal.website_transactions import get_transaction_context context = get_transaction_context("Sales Invoice", webnotes.form_dict.name) diff --git a/portal/templates/pages/invoices.html b/accounts/doctype/sales_invoice/templates/pages/invoices.html similarity index 100% rename from portal/templates/pages/invoices.html rename to accounts/doctype/sales_invoice/templates/pages/invoices.html diff --git a/portal/templates/pages/invoices.py b/accounts/doctype/sales_invoice/templates/pages/invoices.py similarity index 97% rename from portal/templates/pages/invoices.py rename to accounts/doctype/sales_invoice/templates/pages/invoices.py index 2bb6490903..c72903ba12 100644 --- a/portal/templates/pages/invoices.py +++ b/accounts/doctype/sales_invoice/templates/pages/invoices.py @@ -4,6 +4,8 @@ from __future__ import unicode_literals import webnotes +no_cache = True + def get_context(): from portal.website_transactions import get_currency_context context = get_currency_context() diff --git a/config.json b/config.json index 3f5851113d..17b01edb25 100644 --- a/config.json +++ b/config.json @@ -72,111 +72,5 @@ "label": "Notes", "icon": "icon-file-alt" } - }, - "web": { - "pages": { - "account": { - "no_cache": true, - "template": "app/portal/templates/account.html" - }, - "order": { - "no_cache": true, - "template": "app/portal/templates/sale.html", - "args_method": "utilities.website_transactions.get_order_args", - "portal": { - "doctype": "Sales Order", - "conditions": { - "docstatus": 1 - } - } - }, - "orders": { - "no_cache": true, - "template": "app/portal/templates/sales_transactions.html", - "args_method": "utilities.website_transactions.order_list_args" - }, - "invoice": { - "no_cache": true, - "template": "app/portal/templates/sale.html", - "args_method": "utilities.website_transactions.get_invoice_args", - "portal": { - "doctype": "Sales Invoice", - "conditions": { - "docstatus": 1 - } - } - }, - "invoices": { - "no_cache": true, - "template": "app/portal/templates/sales_transactions.html", - "args_method": "utilities.website_transactions.invoice_list_args" - }, - "shipment": { - "no_cache": true, - "template": "app/portal/templates/sale.html", - "args_method": "utilities.website_transactions.get_shipment_args", - "portal": { - "doctype": "Delivery Note", - "conditions": { - "docstatus": 1 - } - } - }, - "shipments": { - "no_cache": true, - "template": "app/portal/templates/sales_transactions.html", - "args_method": "utilities.website_transactions.shipment_list_args" - }, - "product_search": { - "template": "app/stock/doctype/item/templates/product_search.html" - }, - "ticket": { - "no_cache": true, - "template": "app/support/doctype/support_ticket/templates/ticket.html", - "args_method": "support.doctype.support_ticket.support_ticket.get_website_args", - "portal": { - "doctype": "Support Ticket" - } - }, - "tickets": { - "template": "app/support/doctype/support_ticket/templates/tickets.html", - "args_method": "utilities.website_transactions.ticket_list_args" - }, - "address": { - "no_cache": true, - "template": "app/utilities/doctype/address/templates/address.html", - "args_method": "utilities.doctype.address.address.get_website_args" - }, - "addresses": { - "template": "app/utilities/doctype/address/templates/addresses.html" - }, - "profile": { - "no_cache": true, - "template": "app/portal/templates/profile.html", - "args_method": "startup.webutils.get_profile_args" - }, - "cart": { - "no_cache": true, - "template": "app/portal/templates/cart.html" - }, - "partners": { - "template": "app/setup/doctype/sales_partners/templates/partners.html", - "args_method": "setup.doctype.sales_partner.sales_partner.get_partner_args" - } - }, - "generators": { - "Item": { - "template": "app/stock/doctype/item/templates/item.html", - "condition_field": "show_in_website" - }, - "Item Group":{ - "template": "app/setup/doctype/item_group/templates/item_group.html", - "condition_field": "show_in_website" - }, - "Sales Partner": { - "template": "app/setup/doctype/sales_partner/templates/partner_page.html", - "condition_field": "show_in_website" - } - } } } \ No newline at end of file diff --git a/portal/templates/includes/cart.js b/portal/templates/includes/cart.js index 63c6463ac4..84d49f33c4 100644 --- a/portal/templates/includes/cart.js +++ b/portal/templates/includes/cart.js @@ -128,7 +128,7 @@ $.extend(wn.cart, { render_item_row: function($cart_items, doc) { doc.image_html = doc.image ? '
' : - '{% include "app/website/templates/html/product_missing_image.html" %}'; + '{% include "app/stock/doctype/item/templates/includes/product_missing_image.html" %}'; if(doc.description === doc.item_name) doc.description = ""; diff --git a/portal/templates/pages/account.py b/portal/templates/pages/account.py new file mode 100644 index 0000000000..24b474a55c --- /dev/null +++ b/portal/templates/pages/account.py @@ -0,0 +1,6 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals + +no_cache = True \ No newline at end of file diff --git a/portal/templates/pages/cart.html b/portal/templates/pages/cart.html index 372f5241b0..f210772831 100644 --- a/portal/templates/pages/cart.html +++ b/portal/templates/pages/cart.html @@ -1,7 +1,7 @@ {% extends base_template %} {% block javascript %} - {% include "app/website/templates/js/cart.js" %} + {% endblock %} {% set title="Shopping Cart" %} diff --git a/portal/templates/pages/cart.py b/portal/templates/pages/cart.py new file mode 100644 index 0000000000..24b474a55c --- /dev/null +++ b/portal/templates/pages/cart.py @@ -0,0 +1,6 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals + +no_cache = True \ No newline at end of file diff --git a/portal/templates/pages/profile.html b/portal/templates/pages/profile.html index 2fe03ba911..65f3e37988 100644 --- a/portal/templates/pages/profile.html +++ b/portal/templates/pages/profile.html @@ -9,7 +9,7 @@