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 = {
@ -77,20 +76,20 @@ def make_feed(doc, subject, color):
f.subject = subject f.subject = subject
f.color = color f.color = color
f.save(1) f.save(1)
def update_feed1(doc):
"adds a new feed"
prop_rec = webnotes.conn.sql("select value from `tabProperty Setter` where doc_type = %s and property = 'subject'", (doc.doctype))
if prop_rec:
subject = prop_rec[0][0]
else:
rec = webnotes.conn.sql("select subject from tabDocType where name=%s", (doc.doctype))
subject = rec[0][0]
#def update_feed(doc): subject, color = [subject, feed_dict_color.get(doc.doctype)]
# "adds a new feed" if subject:
# prop_rec = webnotes.conn.sql("select value from `tabProperty Setter` where doc_type = %s and property = 'subject'", (doc.doctype)) subject = subject % doc.fields
# if prop_rec: make_feed(doc, subject, color)
# subject = prop_rec[0][0]
# else:
# rec = webnotes.conn.sql("select subject from tabDocType where name=%s", (doc.doctype))
# subject = rec[0][0]
#
# subject, color = [subject, feed_dict_color.get(doc.doctype)]
# if subject:
# subject = subject % doc.fields
# make_feed(doc, subject, color)
def update_feed(doc): def update_feed(doc):
"adds a new feed" "adds a new feed"