From 429ab205d42857c5e13db95d908fa16d6ad254b7 Mon Sep 17 00:00:00 2001 From: ShashaQin Date: Tue, 9 Feb 2016 16:45:51 +0800 Subject: [PATCH 1/7] Update print_settings.py --- erpnext/controllers/print_settings.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/erpnext/controllers/print_settings.py b/erpnext/controllers/print_settings.py index c5f8e0794a..7dfae0ffb1 100644 --- a/erpnext/controllers/print_settings.py +++ b/erpnext/controllers/print_settings.py @@ -1,9 +1,28 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt +from __future__ import unicode_literals +import frappe +from frappe.utils import cint + def print_settings_for_item_table(doc): + doc.print_templates = { "description": "templates/print_formats/includes/item_table_description.html", "qty": "templates/print_formats/includes/item_table_qty.html" } + customised_print_preview = cint(frappe.db.get_value("Features Setup", None, "customised_print_preview")) + doc.hide_in_print_layout = ["item_code", "item_name", "image", "uom", "stock_uom"] + + std_fields = ["item_code", "item_name", "description", "qty", "rate", "amount", "stock_uom", "uom"] + + if customised_print_preview: + + for df in doc.meta.fields: + if df.fieldtype not in ("Section Break", "Column Break", "Button"): + if not doc.is_print_hide(df.fieldname): + if df.fieldname not in doc.hide_in_print_layout and df.fieldname not in std_fields: + doc.hide_in_print_layout.append(df.fieldname) + + From c77669f3d185585d14b4e2bd2c9a390ba0184689 Mon Sep 17 00:00:00 2001 From: ShashaQin Date: Tue, 9 Feb 2016 16:46:41 +0800 Subject: [PATCH 2/7] Update item_table_description.html --- .../includes/item_table_description.html | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/erpnext/templates/print_formats/includes/item_table_description.html b/erpnext/templates/print_formats/includes/item_table_description.html index 116523ca04..e7fcb65aa9 100644 --- a/erpnext/templates/print_formats/includes/item_table_description.html +++ b/erpnext/templates/print_formats/includes/item_table_description.html @@ -1,11 +1,15 @@ +{%- set std_fields = ("item_code", "item_name", "description", "qty", "rate", "amount", "stock_uom", "uom") -%} +{%- set customised_print_preview = frappe.utils.cint(frappe.db.get_value("Features Setup", None, "customised_print_preview")) -%} + {% if doc.in_format_data("image") and doc.get("image") and not doc.is_print_hide("image")-%}
{%- endif %}
+ {% if doc.in_format_data("item_code") and not doc.is_print_hide("item_code") -%} -
{{ doc.item_code }}
+
{{ doc.item_code }}
{%- endif %} {% if (doc.in_format_data("item_name") and not doc.is_print_hide("item_name") and (not doc.in_format_data("item_code") or doc.is_print_hide("item_code") @@ -21,5 +25,14 @@ )) -%}

{{ doc.get_formatted("description") }}

- {%- endif %} + {%- endif %} + {% if (customised_print_preview == 1) -%} + {%- for field in doc.hide_in_print_layout -%} + {%- if (field not in std_fields) and + (doc.get(field) not in (None, "", 0)) -%} +
{{ doc.meta.get_label(field) }}: + {{ doc.get_formatted(field) }}
+ {%- endif -%} + {%- endfor -%} + {%- endif %}
From 2331d4f9a15aa244560c067eeeb5035fb3b190d7 Mon Sep 17 00:00:00 2001 From: ShashaQin Date: Tue, 9 Feb 2016 16:49:07 +0800 Subject: [PATCH 3/7] Update features_setup.json --- .../features_setup/features_setup.json | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/erpnext/setup/doctype/features_setup/features_setup.json b/erpnext/setup/doctype/features_setup/features_setup.json index 217a23ab9f..0394bc9c75 100644 --- a/erpnext/setup/doctype/features_setup/features_setup.json +++ b/erpnext/setup/doctype/features_setup/features_setup.json @@ -180,6 +180,29 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "description": "if checked, only 5 columns are shown in print preview. Any extra field is shown under 'Description' column.", + "fieldname": "customised_print_preview", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Compact Print Layout", + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -661,7 +684,7 @@ "is_submittable": 0, "issingle": 1, "istable": 0, - "modified": "2015-08-27 03:27:35.694800", + "modified": "2016-01-25 16:42:58.404448", "modified_by": "Administrator", "module": "Setup", "name": "Features Setup", @@ -711,4 +734,4 @@ ], "read_only": 0, "read_only_onload": 0 -} \ No newline at end of file +} From 426bf4b5bbba92ef4ded17c72a673cc386d1e2fc Mon Sep 17 00:00:00 2001 From: ShashaQin Date: Fri, 12 Feb 2016 09:20:59 +0800 Subject: [PATCH 4/7] Update features_setup.json --- erpnext/setup/doctype/features_setup/features_setup.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/setup/doctype/features_setup/features_setup.json b/erpnext/setup/doctype/features_setup/features_setup.json index 0394bc9c75..6db3132d38 100644 --- a/erpnext/setup/doctype/features_setup/features_setup.json +++ b/erpnext/setup/doctype/features_setup/features_setup.json @@ -185,17 +185,19 @@ "bold": 0, "collapsible": 0, "description": "if checked, only 5 columns are shown in print preview. Any extra field is shown under 'Description' column.", - "fieldname": "customised_print_preview", + "fieldname": "compact_item_view", "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, "in_filter": 0, "in_list_view": 0, - "label": "Compact Print Layout", + "label": "Compact Item View", + "length": 0, "no_copy": 0, "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -684,7 +686,7 @@ "is_submittable": 0, "issingle": 1, "istable": 0, - "modified": "2016-01-25 16:42:58.404448", + "modified": "2016-02-12 08:53:48.982439", "modified_by": "Administrator", "module": "Setup", "name": "Features Setup", From fd08750e1cb0e9c9ce27b70abdd635f6791ef7e8 Mon Sep 17 00:00:00 2001 From: ShashaQin Date: Fri, 12 Feb 2016 09:22:05 +0800 Subject: [PATCH 5/7] Update print_settings.py --- erpnext/controllers/print_settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/print_settings.py b/erpnext/controllers/print_settings.py index 7dfae0ffb1..7c00e64529 100644 --- a/erpnext/controllers/print_settings.py +++ b/erpnext/controllers/print_settings.py @@ -11,13 +11,13 @@ def print_settings_for_item_table(doc): "description": "templates/print_formats/includes/item_table_description.html", "qty": "templates/print_formats/includes/item_table_qty.html" } - customised_print_preview = cint(frappe.db.get_value("Features Setup", None, "customised_print_preview")) + compact_item_view = cint(frappe.db.get_value("Features Setup", None, "compact_item_view")) doc.hide_in_print_layout = ["item_code", "item_name", "image", "uom", "stock_uom"] std_fields = ["item_code", "item_name", "description", "qty", "rate", "amount", "stock_uom", "uom"] - if customised_print_preview: + if compact_item_view: for df in doc.meta.fields: if df.fieldtype not in ("Section Break", "Column Break", "Button"): From 541abf56879ec0d59b3265b3f2d0b43fe398408e Mon Sep 17 00:00:00 2001 From: ShashaQin Date: Fri, 12 Feb 2016 09:22:55 +0800 Subject: [PATCH 6/7] Update item_table_description.html --- .../print_formats/includes/item_table_description.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/templates/print_formats/includes/item_table_description.html b/erpnext/templates/print_formats/includes/item_table_description.html index e7fcb65aa9..2a6ef42dbf 100644 --- a/erpnext/templates/print_formats/includes/item_table_description.html +++ b/erpnext/templates/print_formats/includes/item_table_description.html @@ -1,5 +1,5 @@ {%- set std_fields = ("item_code", "item_name", "description", "qty", "rate", "amount", "stock_uom", "uom") -%} -{%- set customised_print_preview = frappe.utils.cint(frappe.db.get_value("Features Setup", None, "customised_print_preview")) -%} +{%- set compact_item_view = frappe.utils.cint(frappe.db.get_value("Features Setup", None, "compact_item_view")) -%} {% if doc.in_format_data("image") and doc.get("image") and not doc.is_print_hide("image")-%}
@@ -26,7 +26,7 @@ -%}

{{ doc.get_formatted("description") }}

{%- endif %} - {% if (customised_print_preview == 1) -%} + {% if (compact_item_view == 1) -%} {%- for field in doc.hide_in_print_layout -%} {%- if (field not in std_fields) and (doc.get(field) not in (None, "", 0)) -%} From 9a933788bee9270cba85f2d0d335fb99c00a4c8d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 16 Feb 2016 15:30:17 +0530 Subject: [PATCH 7/7] [cleanup] Compact Item Print --- erpnext/controllers/print_settings.py | 15 ++-- .../doctype/features_setup/features_setup.js | 5 ++ .../features_setup/features_setup.json | 78 +++++++++++++++++-- .../includes/item_table_description.html | 54 +++++++------ 4 files changed, 114 insertions(+), 38 deletions(-) create mode 100644 erpnext/setup/doctype/features_setup/features_setup.js diff --git a/erpnext/controllers/print_settings.py b/erpnext/controllers/print_settings.py index 7c00e64529..bc34f7c6b3 100644 --- a/erpnext/controllers/print_settings.py +++ b/erpnext/controllers/print_settings.py @@ -6,23 +6,24 @@ import frappe from frappe.utils import cint def print_settings_for_item_table(doc): - + doc.print_templates = { "description": "templates/print_formats/includes/item_table_description.html", "qty": "templates/print_formats/includes/item_table_qty.html" } - compact_item_view = cint(frappe.db.get_value("Features Setup", None, "compact_item_view")) - + doc.hide_in_print_layout = ["item_code", "item_name", "image", "uom", "stock_uom"] - std_fields = ["item_code", "item_name", "description", "qty", "rate", "amount", "stock_uom", "uom"] + doc.flags.compact_item_print = cint(frappe.db.get_value("Features Setup", None, "compact_item_print")) + doc.flags.compact_item_fields = doc.hide_in_print_layout + ["description", "qty", "rate", "amount"] + doc.flags.show_in_description = [] - if compact_item_view: - + if doc.flags.compact_item_print: for df in doc.meta.fields: if df.fieldtype not in ("Section Break", "Column Break", "Button"): if not doc.is_print_hide(df.fieldname): - if df.fieldname not in doc.hide_in_print_layout and df.fieldname not in std_fields: + if df.fieldname not in doc.hide_in_print_layout and df.fieldname not in doc.flags.compact_item_fields: doc.hide_in_print_layout.append(df.fieldname) + doc.flags.show_in_description.append(df.fieldname) diff --git a/erpnext/setup/doctype/features_setup/features_setup.js b/erpnext/setup/doctype/features_setup/features_setup.js new file mode 100644 index 0000000000..a637a8e785 --- /dev/null +++ b/erpnext/setup/doctype/features_setup/features_setup.js @@ -0,0 +1,5 @@ +frappe.ui.form.on('Features Setup', { + refresh: function(frm) { + + } +}); diff --git a/erpnext/setup/doctype/features_setup/features_setup.json b/erpnext/setup/doctype/features_setup/features_setup.json index 6db3132d38..8dea339817 100644 --- a/erpnext/setup/doctype/features_setup/features_setup.json +++ b/erpnext/setup/doctype/features_setup/features_setup.json @@ -18,9 +18,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Materials", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -40,9 +42,11 @@ "in_filter": 0, "in_list_view": 1, "label": "Item Serial Nos", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -62,9 +66,11 @@ "in_filter": 0, "in_list_view": 1, "label": "Item Batch Nos", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -84,9 +90,11 @@ "in_filter": 0, "in_list_view": 1, "label": "Brands", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -106,9 +114,11 @@ "in_filter": 0, "in_list_view": 1, "label": "Item Barcode", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -126,9 +136,11 @@ "ignore_user_permissions": 0, "in_filter": 0, "in_list_view": 0, + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -140,7 +152,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "description": "1. To maintain the customer wise item code and to make them searchable based on their code use this option", + "description": "To maintain the customer wise item code and to make them searchable based on their code use this option", "fieldname": "fs_item_advanced", "fieldtype": "Check", "hidden": 0, @@ -148,9 +160,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Item Advanced", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -170,9 +184,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Item Groups in Details", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -184,14 +200,14 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "description": "if checked, only 5 columns are shown in print preview. Any extra field is shown under 'Description' column.", - "fieldname": "compact_item_view", + "description": "If checked, only Description, Quantity, Rate and Amount are shown in print of Item table. Any extra field is shown under 'Description' column.", + "fieldname": "compact_item_print", "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, "in_filter": 0, "in_list_view": 0, - "label": "Compact Item View", + "label": "Compact Item Print", "length": 0, "no_copy": 0, "permlevel": 0, @@ -204,7 +220,7 @@ "search_index": 0, "set_only_once": 0, "unique": 0 - }, + }, { "allow_on_submit": 0, "bold": 0, @@ -216,9 +232,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Sales and Purchase", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -238,9 +256,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Exports", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -260,9 +280,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Imports", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -280,9 +302,11 @@ "ignore_user_permissions": 0, "in_filter": 0, "in_list_view": 0, + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -302,9 +326,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Sales Discounts", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -324,9 +350,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Purchase Discounts", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -346,9 +374,11 @@ "in_filter": 0, "in_list_view": 0, "label": "After Sale Installations", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -368,9 +398,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Projects", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -390,9 +422,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Sales Extras", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -411,9 +445,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Accounts", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -433,9 +469,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Recurring Invoice", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -453,9 +491,11 @@ "ignore_user_permissions": 0, "in_filter": 0, "in_list_view": 0, + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -475,9 +515,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Point of Sale", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -497,9 +539,11 @@ "in_filter": 0, "in_list_view": 0, "label": "POS View", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -518,9 +562,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Manufacturing", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -540,9 +586,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Manufacturing", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -560,9 +608,11 @@ "ignore_user_permissions": 0, "in_filter": 0, "in_list_view": 0, + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -582,9 +632,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Quality", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -603,9 +655,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Miscelleneous", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -625,9 +679,11 @@ "in_filter": 0, "in_list_view": 0, "label": "Page Break", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -645,9 +701,11 @@ "ignore_user_permissions": 0, "in_filter": 0, "in_list_view": 0, + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -666,9 +724,11 @@ "in_filter": 0, "in_list_view": 0, "label": "More Information", + "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -686,7 +746,8 @@ "is_submittable": 0, "issingle": 1, "istable": 0, - "modified": "2016-02-12 08:53:48.982439", + "max_attachments": 0, + "modified": "2016-02-16 04:43:32.144944", "modified_by": "Administrator", "module": "Setup", "name": "Features Setup", @@ -735,5 +796,6 @@ } ], "read_only": 0, - "read_only_onload": 0 -} + "read_only_onload": 0, + "sort_order": "ASC" +} \ No newline at end of file diff --git a/erpnext/templates/print_formats/includes/item_table_description.html b/erpnext/templates/print_formats/includes/item_table_description.html index 2a6ef42dbf..a9f7bcce4a 100644 --- a/erpnext/templates/print_formats/includes/item_table_description.html +++ b/erpnext/templates/print_formats/includes/item_table_description.html @@ -1,38 +1,46 @@ -{%- set std_fields = ("item_code", "item_name", "description", "qty", "rate", "amount", "stock_uom", "uom") -%} -{%- set compact_item_view = frappe.utils.cint(frappe.db.get_value("Features Setup", None, "compact_item_view")) -%} +{%- set compact = doc.flags.compact_item_print -%} +{%- set compact_fields = doc.flags.compact_item_fields -%} {% if doc.in_format_data("image") and doc.get("image") and not doc.is_print_hide("image")-%}
- +
{%- endif %} +
- - {% if doc.in_format_data("item_code") and not doc.is_print_hide("item_code") -%} -
{{ doc.item_code }}
- {%- endif %} - {% if (doc.in_format_data("item_name") and not doc.is_print_hide("item_name") and - (not doc.in_format_data("item_code") or doc.is_print_hide("item_code") + {% if doc.in_format_data("item_code") and not doc.is_print_hide("item_code") -%} +
+ {% if compact %}{% endif %} + {{ doc.item_code }} + {% if compact %}{% endif %} +
+ {%- endif %} + + {% if (doc.in_format_data("item_name") and not doc.is_print_hide("item_name") and + (not doc.in_format_data("item_code") or doc.is_print_hide("item_code") or doc.item_code != doc.item_name)) -%} -
{{ doc.get_formatted("item_name") }}
- {%- endif %} - {% if (doc.in_format_data("description") and doc.description and - ( +
{{ doc.get_formatted("item_name") }}
+ {%- endif %} + + {% if (doc.in_format_data("description") and doc.description and + ( ( (not doc.in_format_data("item_code") or doc.is_print_hide("item_code")) and (not doc.in_format_data("item_name") or doc.is_print_hide("item_name")) ) or not (doc.item_code == doc.item_name == doc.description) )) -%} -

{{ doc.get_formatted("description") }}

- {%- endif %} - {% if (compact_item_view == 1) -%} - {%- for field in doc.hide_in_print_layout -%} - {%- if (field not in std_fields) and - (doc.get(field) not in (None, "", 0)) -%} -
{{ doc.meta.get_label(field) }}: - {{ doc.get_formatted(field) }}
- {%- endif -%} - {%- endfor -%} +

{{ doc.get_formatted("description") }}

+ {%- endif %} + + {% if compact -%} + {%- for fieldname in doc.flags.show_in_description -%} + {% if doc.get(fieldname) -%} +

+ {{ doc.meta.get_label(fieldname) }}: + {{ doc.get_formatted(fieldname) }} +

+ {% endif %} + {%- endfor -%} {%- endif %}