fix: show only projects with access in customer portal
This commit is contained in:
parent
07d2b896c1
commit
610ead22e8
@ -13,6 +13,7 @@ from frappe.utils import add_days, flt, get_datetime, get_time, get_url, nowtime
|
|||||||
|
|
||||||
from erpnext import get_default_company
|
from erpnext import get_default_company
|
||||||
from erpnext.controllers.queries import get_filters_cond
|
from erpnext.controllers.queries import get_filters_cond
|
||||||
|
from erpnext.controllers.website_list_for_contact import get_customers_suppliers
|
||||||
from erpnext.setup.doctype.holiday_list.holiday_list import is_holiday
|
from erpnext.setup.doctype.holiday_list.holiday_list import is_holiday
|
||||||
|
|
||||||
|
|
||||||
@ -318,6 +319,7 @@ def get_timeline_data(doctype: str, name: str) -> dict[int, int]:
|
|||||||
def get_project_list(
|
def get_project_list(
|
||||||
doctype, txt, filters, limit_start, limit_page_length=20, order_by="modified"
|
doctype, txt, filters, limit_start, limit_page_length=20, order_by="modified"
|
||||||
):
|
):
|
||||||
|
customers, suppliers = get_customers_suppliers("Project", frappe.session.user)
|
||||||
meta = frappe.get_meta(doctype)
|
meta = frappe.get_meta(doctype)
|
||||||
if not filters:
|
if not filters:
|
||||||
filters = []
|
filters = []
|
||||||
@ -325,6 +327,7 @@ def get_project_list(
|
|||||||
fields = "distinct *"
|
fields = "distinct *"
|
||||||
|
|
||||||
or_filters = []
|
or_filters = []
|
||||||
|
filters.append([doctype, "customer", "in", customers])
|
||||||
|
|
||||||
if txt:
|
if txt:
|
||||||
if meta.search_fields:
|
if meta.search_fields:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user