From 0feaafff21f4618f957dc655059fa40df1bb4733 Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Thu, 25 Feb 2021 15:37:07 +0530 Subject: [PATCH] fix: respect % width while building print formats --- frappe/templates/print_formats/standard_macros.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frappe/templates/print_formats/standard_macros.html b/frappe/templates/print_formats/standard_macros.html index 0186346840..a637a7befb 100644 --- a/frappe/templates/print_formats/standard_macros.html +++ b/frappe/templates/print_formats/standard_macros.html @@ -165,7 +165,12 @@ data-fieldname="{{ df.fieldname }}" data-fieldtype="{{ df.fieldtype }}" {%- endmacro %} {% macro get_width(df) -%} - {%- if df.print_width -%}{{ (df.print_width|str).replace("px", "") }}px + {%- if df.print_width -%} + {%- if df.print_width.endswith("%") -%} + {{ df.print_width }} + {%- else -%} + {{ (df.print_width|str).replace("px", "") }}px + {%- endif -%} {%- elif df.fieldtype in ("Int", "Check", "Float", "Currency") -%}{{ 80 }}px {%- else -%}{{ 150 }}px{% endif -%} {%- endmacro %}