From 2b8344e75c9bf6b11e2d10e0e06b12bbe8ccffdf Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 5 Aug 2014 11:30:37 +0530 Subject: [PATCH] [print] [fix] when item grid is empty --- erpnext/templates/print_formats/includes/item_grid.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/templates/print_formats/includes/item_grid.html b/erpnext/templates/print_formats/includes/item_grid.html index d6ab347c922..a51339c5169 100644 --- a/erpnext/templates/print_formats/includes/item_grid.html +++ b/erpnext/templates/print_formats/includes/item_grid.html @@ -1,8 +1,8 @@ {%- from "templates/print_formats/standard_macros.html" import print_value -%} {%- set std_fields = ("item_code", "item_name", "description", "qty", "rate", "amount", "stock_uom", "uom") -%} {%- set visible_columns = get_visible_columns(doc.get(df.fieldname), table_meta) -%} -{%- set hide_rate = data[0].meta.is_print_hide("rate") -%} -{%- set hide_amount = data[0].meta.is_print_hide("amount") -%} +{%- set hide_rate = data[0].meta.is_print_hide("rate") if len(data) else False-%} +{%- set hide_amount = data[0].meta.is_print_hide("amount") if len(data) else False-%}