From 25ef4ff37329e5313c9415cfdfb61e97bbd9a806 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 20 Oct 2015 18:34:21 +0530 Subject: [PATCH] [fix] variant selector display --- erpnext/patches/v6_4/make_image_thumbnail.py | 4 +- erpnext/templates/generators/item.html | 40 ++++++++++---------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/erpnext/patches/v6_4/make_image_thumbnail.py b/erpnext/patches/v6_4/make_image_thumbnail.py index 36bdcfc6d4..702148a8f6 100644 --- a/erpnext/patches/v6_4/make_image_thumbnail.py +++ b/erpnext/patches/v6_4/make_image_thumbnail.py @@ -3,8 +3,8 @@ import frappe def execute(): frappe.reload_doctype("File") frappe.reload_doctype("Item") - for item in frappe.get_all("Item", fields=("name", "website_image")): - if item.website_image: + for item in frappe.get_all("Item", fields=("name", "website_image", "thumbnail")): + if item.website_image and not item.thumbnail: item_doc = frappe.get_doc("Item", item.name) try: item_doc.make_thumbnail() diff --git a/erpnext/templates/generators/item.html b/erpnext/templates/generators/item.html index ccb992b804..4bd521d5a7 100644 --- a/erpnext/templates/generators/item.html +++ b/erpnext/templates/generators/item.html @@ -26,29 +26,31 @@

{{ _("Item Code") }}: {{ name }}


+
+ {% if has_variants %} + {% for d in attributes %} +
+
{{ _(d.attribute) }}
+ +
+ {% endfor %} + {% endif %} +
+

- {% if has_variants %} - {% for d in attributes %} -
-
{{ _(d.attribute) }}
- -
- {% endfor %} - {% endif %} -