brotherton-erpnext/erpnext/hr/page/team_updates/team_updates.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
643 B
Python
Raw Normal View History

2017-01-31 06:12:44 +00:00
from __future__ import unicode_literals
import frappe
from email_reply_parser import EmailReplyParser
@frappe.whitelist()
def get_data(start=0):
#frappe.only_for('Employee', 'System Manager')
data = frappe.get_all('Communication',
fields=('content', 'text_content', 'sender', 'creation'),
filters=dict(reference_doctype='Daily Work Summary'),
order_by='creation desc', limit=40, start=start)
for d in data:
d.sender_name = frappe.db.get_value("Employee", {"user_id": d.sender},
"employee_name") or d.sender
if d.text_content:
d.content = frappe.utils.md_to_html(EmailReplyParser.parse_reply(d.text_content))
2017-01-31 06:12:44 +00:00
return data