Anand Doshi | 5d591eb | 2014-04-18 16:15:31 +0530 | [diff] [blame] | 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors |
| 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
| 4 | from __future__ import unicode_literals |
| 5 | |
| 6 | import frappe |
| 7 | from erpnext.setup.doctype.item_group.item_group import get_parent_item_groups |
| 8 | from frappe.website.doctype.website_slideshow.website_slideshow import get_slideshow |
| 9 | |
| 10 | doctype = "Item" |
| 11 | condition_field = "show_in_website" |
| 12 | |
| 13 | def 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 |