From 9306aff1bb4024cacfd6c25249ad34ec0e5464ba Mon Sep 17 00:00:00 2001 From: Makarand Bauskar Date: Fri, 21 Jul 2017 15:19:47 +0530 Subject: [PATCH] [minor] moved the patch to v8_5 and other minor fixes (#10012) * Quotation and Supplier Quotation Route and Permission Edits * [minor] moved the patch to v8_5 and other minor fixes --- erpnext/hooks.py | 17 ++++++++++++----- erpnext/patches.txt | 3 ++- .../v8_5/remove_quotations_route_in_sidebar.py | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 erpnext/patches/v8_5/remove_quotations_route_in_sidebar.py diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 472d8f9a9e..5f0b19ebd7 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -72,14 +72,20 @@ website_route_rules = [ "parents": [{"title": _("Invoices"), "name": "invoices"}] } }, - {"from_route": "/quotations", "to_route": "Supplier Quotation"}, - {"from_route": "/quotations/", "to_route": "order", + {"from_route": "/supplier-quotations", "to_route": "Supplier Quotation"}, + {"from_route": "/supplier-quotations/", "to_route": "order", "defaults": { "doctype": "Supplier Quotation", "parents": [{"title": _("Supplier Quotation"), "name": "quotations"}] } }, - {"from_route": "/quotation", "to_route": "Quotation"}, + {"from_route": "/quotations", "to_route": "Quotation"}, + {"from_route": "/quotations/", "to_route": "order", + "defaults": { + "doctype": "Quotation", + "parents": [{"title": _("Quotations"), "name": "quotation"}] + } + }, {"from_route": "/shipments", "to_route": "Delivery Note"}, {"from_route": "/shipments/", "to_route": "order", "defaults": { @@ -109,8 +115,8 @@ website_route_rules = [ 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": _("Quotations"), "route": "/quotation", "reference_doctype": "Quotation", "role":"Customer"}, + {"title": _("Supplier Quotation"), "route": "/supplier-quotations", "reference_doctype": "Supplier Quotation", "role": "Supplier"}, + {"title": _("Quotations"), "route": "/quotations", "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"}, @@ -127,6 +133,7 @@ default_roles = [ has_website_permission = { "Sales Order": "erpnext.controllers.website_list_for_contact.has_website_permission", + "Quotation": "erpnext.controllers.website_list_for_contact.has_website_permission", "Sales Invoice": "erpnext.controllers.website_list_for_contact.has_website_permission", "Supplier Quotation": "erpnext.controllers.website_list_for_contact.has_website_permission", "Delivery Note": "erpnext.controllers.website_list_for_contact.has_website_permission", diff --git a/erpnext/patches.txt b/erpnext/patches.txt index fb8f02e94b..834ed2fdf4 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -423,4 +423,5 @@ erpnext.patches.v8_3.set_restrict_to_domain_for_module_def erpnext.patches.v8_1.update_expense_claim_status erpnext.patches.v8_3.update_company_total_sales erpnext.patches.v8_1.set_delivery_date_in_so_item -erpnext.patches.v8_5.fix_tax_breakup_for_non_invoice_docs \ No newline at end of file +erpnext.patches.v8_5.fix_tax_breakup_for_non_invoice_docs +erpnext.patches.v8_5.remove_quotations_route_in_sidebar \ No newline at end of file diff --git a/erpnext/patches/v8_5/remove_quotations_route_in_sidebar.py b/erpnext/patches/v8_5/remove_quotations_route_in_sidebar.py new file mode 100644 index 0000000000..2d7df4a179 --- /dev/null +++ b/erpnext/patches/v8_5/remove_quotations_route_in_sidebar.py @@ -0,0 +1,16 @@ +# Copyright (c) 2017, Frappe and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe + +def execute(): + frappe.reload_doctype("Portal Settings") + + frappe.db.sql(""" + delete from + `tabPortal Menu Item` + where + (route = '/quotations' and title = 'Supplier Quotation') + or (route = '/quotation' and title = 'Quotations') + """) \ No newline at end of file