mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00:00
[enhancement] configurable portal menu;
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
import frappe.defaults
|
||||
from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import is_cart_enabled
|
||||
|
||||
@@ -30,29 +29,6 @@ def update_website_context(context):
|
||||
cart_enabled = is_cart_enabled()
|
||||
context["shopping_cart_enabled"] = cart_enabled
|
||||
|
||||
def update_my_account_context(context):
|
||||
check_user_role, parties = check_customer_or_supplier()
|
||||
|
||||
if check_user_role == 'Supplier':
|
||||
get_supplier_context(context)
|
||||
else:
|
||||
get_customer_context(context)
|
||||
|
||||
def get_supplier_context(context):
|
||||
context["my_account_list"].extend([
|
||||
{"label": _("Request for Quotations"), "url": "rfq"},
|
||||
])
|
||||
|
||||
def get_customer_context(context):
|
||||
context["my_account_list"].extend([
|
||||
{"label": _("Projects"), "url": "project"},
|
||||
{"label": _("Orders"), "url": "orders"},
|
||||
{"label": _("Invoices"), "url": "invoices"},
|
||||
{"label": _("Shipments"), "url": "shipments"},
|
||||
{"label": _("Issues"), "url": "issues"},
|
||||
{"label": _("Addresses"), "url": "addresses"}
|
||||
])
|
||||
|
||||
def check_customer_or_supplier():
|
||||
if frappe.session.user:
|
||||
contacts = frappe.get_all("Contact", fields=["customer", "supplier", "email_id"],
|
||||
|
||||
Reference in New Issue
Block a user