blob: 1ad070ef87f77e556b046e1bd78bcec4f22864ba [file] [log] [blame]
Anand Doshi5d591eb2014-04-18 16:15:31 +05301# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
2# License: GNU General Public License v3. See license.txt
3
4from __future__ import unicode_literals
5
6import frappe
7from erpnext.setup.doctype.item_group.item_group import get_parent_item_groups
8from frappe.website.doctype.website_slideshow.website_slideshow import get_slideshow
9
10doctype = "Item"
11condition_field = "show_in_website"
12
13def get_context(context):
14 item_context = context.doc.as_dict()
15 item_context["parent_groups"] = get_parent_item_groups(context.doc.item_group) + \
16 [{"name":context.doc.name}]
17 if context.doc.slideshow:
18 item_context.update(get_slideshow(context.doc))
19
20 return item_context