소스 검색

fix: get_count API endpoint

Make get_count work with join queries
version-14
leela 4 년 전
부모
커밋
566f8ba12a
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. +3
    -1
      frappe/desk/reportview.py

+ 3
- 1
frappe/desk/reportview.py 파일 보기

@@ -31,7 +31,9 @@ def get_list():
@frappe.read_only()
def get_count():
args = get_form_params()
args.fields = ['{distinct}count(name) as total_count'.format(distinct = 'distinct ' if args.distinct=='true' else '')]

distinct = 'distinct ' if args.distinct=='true' else ''
args.fields = [f"count({distinct}`tab{args.doctype}`.name) as total_count"]
return execute(**args)[0].get('total_count')

def execute(doctype, *args, **kwargs):


불러오는 중...
취소
저장