[fix] variant website page render

This commit is contained in:
Anand Doshi
2015-10-21 16:36:18 +05:30
parent 99ba924303
commit d1441245fb

View File

@@ -144,10 +144,11 @@ class Item(WebsiteGenerator):
filters={"variant_of": self.name, "show_in_website": 1}, order_by="name asc") filters={"variant_of": self.name, "show_in_website": 1}, order_by="name asc")
variant = frappe.form_dict.variant variant = frappe.form_dict.variant
if not variant: if not variant and context.variants:
# the case when the item is opened for the first time from its list # the case when the item is opened for the first time from its list
variant = context.variants[0] variant = context.variants[0]
if variant:
context.variant = frappe.get_doc("Item", variant) context.variant = frappe.get_doc("Item", variant)
for fieldname in ("website_image", "web_long_description", "description", for fieldname in ("website_image", "web_long_description", "description",