mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
[Fixes] Supplier can view their addresses, default buying price list issue
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user