[Fixes] Supplier can view their addresses, default buying price list issue

This commit is contained in:
Rohit Waghchaure
2016-04-04 18:49:26 +05:30
parent f4d1b18895
commit ae270d6648
5 changed files with 39 additions and 36 deletions

View File

@@ -31,6 +31,9 @@ def get_transaction_list(doctype, txt=None, filters=None, limit_start=0, limit_p
parties_doctype = 'Request for Quotation Supplier' if doctype == 'Request for Quotation' else doctype
# find party for this contact
customers, suppliers = get_customers_suppliers(parties_doctype, user)
if not customers and not suppliers: return []
key, parties = get_party_details(customers, suppliers)
if doctype == 'Request for Quotation':
@@ -93,7 +96,6 @@ def post_process(doctype, data):
return result
def get_customers_suppliers(doctype, user):
from erpnext.shopping_cart.cart import get_customer
meta = frappe.get_meta(doctype)
contacts = frappe.get_all("Contact", fields=["customer", "supplier", "email_id"],
filters={"email_id": user})
@@ -101,9 +103,6 @@ def get_customers_suppliers(doctype, user):
customers = [c.customer for c in contacts if c.customer] if meta.get_field("customer") else None
suppliers = [c.supplier for c in contacts if c.supplier] if meta.get_field("supplier") else None
if not customers and not suppliers:
return [get_customer().name], None
return customers, suppliers
def has_website_permission(doc, ptype, user, verbose=False):