[fix] Patch template item to be shown in website, show variant's description and price on change of attribute

This commit is contained in:
Anand Doshi
2015-10-20 17:30:02 +05:30
parent 73286dd9f5
commit 7c0eadb451
9 changed files with 136 additions and 38 deletions

View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

View File

@@ -0,0 +1,15 @@
from __future__ import unicode_literals
import frappe
import frappe.website.render
def execute():
for item_code in frappe.db.sql_list("""select distinct variant_of from `tabItem`
where variant_of is not null and variant_of !='' and show_in_website=1"""):
item = frappe.get_doc("Item", item_code)
item.db_set("show_in_website", 1, update_modified=False)
item.get_route()
item.db_set("page_name", item.page_name, update_modified=False)
frappe.website.render.clear_cache()