Procházet zdrojové kódy

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

version-14
rohitwaghchaure před 7 roky
committed by Nabin Hait
rodič
revize
5d6fdb8f05
1 změnil soubory, kde provedl 5 přidání a 2 odebrání
  1. +5
    -2
      frappe/www/printview.py

+ 5
- 2
frappe/www/printview.py Zobrazit soubor

@@ -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:


Načítá se…
Zrušit
Uložit