def update_feed(doc, method=None):
 if (frappe.flags.in_patch or frappe.flags.in_install or frappe.flags.in_import):
  return
 if ((doc._action != u'save') or doc.flags.ignore_feed):
  return
 if ((doc.doctype == u'Communication') or doc.meta.issingle):
  return
 if hasattr(doc, u'get_feed'):
  feed = doc.get_feed()
  if feed:
   if isinstance(feed, basestring):
    feed = {u'subject': feed}
   feed = frappe._dict(feed)
   doctype = (feed.doctype or doc.doctype)
   name = (feed.name or doc.name)
   frappe.db.sql(u"delete from `tabCommunication`\n DCTB  DCTB  DCTB  DCTB where\n DCTB  DCTB  DCTB  DCTB  DCTB reference_doctype=%s and reference_name=%s\n DCTB  DCTB  DCTB  DCTB  DCTB and communication_type='Comment'\n DCTB  DCTB  DCTB  DCTB  DCTB and comment_type='Updated'", (doctype, name))
   frappe.get_doc({u'doctype': u'Communication', u'communication_type': u'Comment', u'comment_type': u'Updated', u'reference_doctype': doctype, u'reference_name': name, u'subject': feed.subject, u'full_name': get_fullname(doc.owner), u'reference_owner': frappe.db.get_value(doctype, name, u'owner'), u'link_doctype': feed.link_doctype, u'link_name': feed.link_name}).insert(ignore_permissions=True)

def update_feed ( doc , method = None ) : if ( frappe . flags . in_patch or frappe . flags . in_install or frappe . flags . in_import ) : return if ( ( doc . _action != u'save' ) or doc . flags . ignore_feed ) : return if ( ( doc . doctype == u'Communication' ) or doc . meta . issingle ) : return if hasattr ( doc , u'get_feed' ) : feed = doc . get_feed ( ) if feed : if isinstance ( feed , basestring ) : feed = { u'subject' : feed } feed = frappe . _dict ( feed ) doctype = ( feed . doctype or doc . doctype ) name = ( feed . name or doc . name ) frappe . db . sql ( u"delete from `tabCommunication`\n DCTB  DCTB  DCTB  DCTB where\n DCTB  DCTB  DCTB  DCTB  DCTB reference_doctype=%s and reference_name=%s\n DCTB  DCTB  DCTB  DCTB  DCTB and communication_type='Comment'\n DCTB  DCTB  DCTB  DCTB  DCTB and comment_type='Updated'" , ( doctype , name ) ) frappe . get_doc ( { u'doctype' : u'Communication' , u'communication_type' : u'Comment' , u'comment_type' : u'Updated' , u'reference_doctype' : doctype , u'reference_name' : name , u'subject' : feed . subject , u'full_name' : get_fullname ( doc . owner ) , u'reference_owner' : frappe . db . get_value ( doctype , name , u'owner' ) , u'link_doctype' : feed . link_doctype , u'link_name' : feed . link_name } ) . insert ( ignore_permissions = True )
save updated feed into path provided as argument .