소스 검색

Show zero rate column in the print if print_hide_if_no_value is disabled (#4694)

version-14
rohitwaghchaure 7 년 전
committed by Nabin Hait
부모
커밋
5d6fdb8f05
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. +5
    -2
      frappe/www/printview.py

+ 5
- 2
frappe/www/printview.py 파일 보기

@@ -398,7 +398,7 @@ def get_visible_columns(data, table_meta, df):
doc = data[0] or frappe.new_doc(df.options)
def add_column(col_df):
return is_visible(col_df, doc) \
and column_has_value(data, col_df.get("fieldname"))
and column_has_value(data, col_df.get("fieldname"), col_df)

if df.get("visible_columns"):
# columns specified by column builder
@@ -418,10 +418,13 @@ def get_visible_columns(data, table_meta, df):

return columns

def column_has_value(data, fieldname):
def column_has_value(data, fieldname, col_df):
"""Check if at least one cell in column has non-zero and non-blank value"""
has_value = False

if col_df.fieldtype in ['Float', 'Currency'] and not col_df.print_hide_if_no_value:
return True

for row in data:
value = row.get(fieldname)
if value:


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