From 7a2815299ea933bd9c4ed804df473a0cd7dc44f3 Mon Sep 17 00:00:00 2001 From: creamdory Date: Wed, 5 Jul 2017 17:07:24 +0800 Subject: [PATCH] Added Quotation as Standard Sidebar Menu --- erpnext/hooks.py | 8 ++++++++ erpnext/selling/doctype/quotation/quotation.py | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index ec93f626e3..0966485cfe 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -80,6 +80,13 @@ website_route_rules = [ "parents": [{"title": _("Supplier Quotation"), "name": "quotations"}] } }, + {"from_route": "/quotes", "to_route": "Quotation"}, + {"from_route": "/quotes/", "to_route": "order", + "defaults": { + "doctype": "Quotation", + "parents": [{"title": _("Quotes"), "name": "quotes"}] + } + }, {"from_route": "/shipments", "to_route": "Delivery Note"}, {"from_route": "/shipments/", "to_route": "order", "defaults": { @@ -110,6 +117,7 @@ standard_portal_menu_items = [ {"title": _("Projects"), "route": "/project", "reference_doctype": "Project"}, {"title": _("Request for Quotations"), "route": "/rfq", "reference_doctype": "Request for Quotation", "role": "Supplier"}, {"title": _("Supplier Quotation"), "route": "/quotations", "reference_doctype": "Supplier Quotation", "role": "Supplier"}, + {"title": _("Quotes"), "route": "/quotes", "reference_doctype": "Quotation", "role":"Customer"}, {"title": _("Orders"), "route": "/orders", "reference_doctype": "Sales Order", "role":"Customer"}, {"title": _("Invoices"), "route": "/invoices", "reference_doctype": "Sales Invoice", "role":"Customer"}, {"title": _("Shipments"), "route": "/shipments", "reference_doctype": "Delivery Note", "role":"Customer"}, diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index b102e1d699..a4d4bf9324 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -86,6 +86,17 @@ class Quotation(SellingController): print_lst.append(lst1) return print_lst +def get_list_context(context=None): + from erpnext.controllers.website_list_for_contact import get_list_context + list_context = get_list_context(context) + list_context.update({ + 'show_sidebar': True, + 'show_search': True, + 'no_breadcrumbs': True, + 'title': _('Quotes'), + }) + + return list_context @frappe.whitelist() def make_sales_order(source_name, target_doc=None):