home feeds

This commit is contained in:
Ravi Dey 2011-07-04 17:18:01 +05:30
parent c1886b5b13
commit 913d7b51ae

View File

@ -3,7 +3,7 @@ from webnotes import msgprint
feed_dict = { feed_dict = {
# Project # Project
'Ticket': ['[%(status)s] %(subject)s', '#000080'], 'Project': ['[%(status)s] %(subject)s', '#000080'],
# Sales # Sales
'Lead': ['%(lead_name)s', '#000080'], 'Lead': ['%(lead_name)s', '#000080'],
@ -30,8 +30,7 @@ feed_dict = {
# Support # Support
'Customer Issue': ['[%(status)s] %(description)s by %(customer_name)s', '#000080'], 'Customer Issue': ['[%(status)s] %(description)s by %(customer_name)s', '#000080'],
'Maintenance Visit':['To %(customer_name)s', '#4169E1'], 'Maintenance Visit':['To %(customer_name)s', '#4169E1'],
#'Support Ticket': ['[%(status)s] %(subject)s', '#000080'] 'Support Ticket': ['[%(status)s] %(subject)s', '#000080']
'Support Ticket': '#000080'
} }
feed_dict_color = { feed_dict_color = {
@ -78,19 +77,19 @@ def make_feed(doc, subject, color):
f.color = color f.color = color
f.save(1) f.save(1)
#def update_feed(doc): def update_feed1(doc):
# "adds a new feed" "adds a new feed"
# prop_rec = webnotes.conn.sql("select value from `tabProperty Setter` where doc_type = %s and property = 'subject'", (doc.doctype)) prop_rec = webnotes.conn.sql("select value from `tabProperty Setter` where doc_type = %s and property = 'subject'", (doc.doctype))
# if prop_rec: if prop_rec:
# subject = prop_rec[0][0] subject = prop_rec[0][0]
# else: else:
# rec = webnotes.conn.sql("select subject from tabDocType where name=%s", (doc.doctype)) rec = webnotes.conn.sql("select subject from tabDocType where name=%s", (doc.doctype))
# subject = rec[0][0] subject = rec[0][0]
#
# subject, color = [subject, feed_dict_color.get(doc.doctype)] subject, color = [subject, feed_dict_color.get(doc.doctype)]
# if subject: if subject:
# subject = subject % doc.fields subject = subject % doc.fields
# make_feed(doc, subject, color) make_feed(doc, subject, color)
def update_feed(doc): def update_feed(doc):
"adds a new feed" "adds a new feed"