This commit is contained in:
@@ -39,16 +39,16 @@ feed_dict = {
|
|||||||
# Accounts
|
# Accounts
|
||||||
'Journal Voucher': ['[%(voucher_type)s] %(name)s', '#4169E1'],
|
'Journal Voucher': ['[%(voucher_type)s] %(name)s', '#4169E1'],
|
||||||
'Purchase Invoice': ['To %(supplier_name)s for %(currency)s %(grand_total_import)s', '#4169E1'],
|
'Purchase Invoice': ['To %(supplier_name)s for %(currency)s %(grand_total_import)s', '#4169E1'],
|
||||||
'Sales Invoice':['To %(customer_name)s for %(currency)s %(grand_total_export)s', '#4169E1'],
|
'Sales Invoice': ['To %(customer_name)s for %(currency)s %(grand_total_export)s', '#4169E1'],
|
||||||
|
|
||||||
# HR
|
# HR
|
||||||
'Expense Claim': ['[%(approval_status)s] %(name)s by %(employee_name)s', '#4169E1'],
|
'Expense Claim': ['[%(approval_status)s] %(name)s by %(employee_name)s', '#4169E1'],
|
||||||
'Salary Slip': ['%(employee_name)s for %(month)s %(fiscal_year)s', '#4169E1'],
|
'Salary Slip': ['%(employee_name)s for %(month)s %(fiscal_year)s', '#4169E1'],
|
||||||
'Leave Transaction':['%(leave_type)s for %(employee)s', '#4169E1'],
|
'Leave Transaction': ['%(leave_type)s for %(employee)s', '#4169E1'],
|
||||||
|
|
||||||
# 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'],
|
||||||
|
|
||||||
# Website
|
# Website
|
||||||
@@ -71,7 +71,7 @@ def make_feed(feedtype, doctype, name, owner, subject, color):
|
|||||||
where doc_type=%s and doc_name=%s
|
where doc_type=%s and doc_name=%s
|
||||||
and ifnull(feed_type,'') != 'Comment'""", (doctype, name))
|
and ifnull(feed_type,'') != 'Comment'""", (doctype, name))
|
||||||
|
|
||||||
f = frappe.get_doc('Feed')
|
f = frappe.new_doc('Feed')
|
||||||
f.owner = owner
|
f.owner = owner
|
||||||
f.feed_type = feedtype
|
f.feed_type = feedtype
|
||||||
f.doc_type = doctype
|
f.doc_type = doctype
|
||||||
@@ -81,16 +81,15 @@ def make_feed(feedtype, doctype, name, owner, subject, color):
|
|||||||
f.full_name = get_fullname(owner)
|
f.full_name = get_fullname(owner)
|
||||||
f.save()
|
f.save()
|
||||||
|
|
||||||
def update_feed(bean, method=None):
|
def update_feed(doc, method=None):
|
||||||
"adds a new feed"
|
"adds a new feed"
|
||||||
doc = bean.doc
|
|
||||||
if method in ['on_update', 'on_submit']:
|
if method in ['on_update', 'on_submit']:
|
||||||
subject, color = feed_dict.get(doc.doctype, [None, None])
|
subject, color = feed_dict.get(doc.doctype, [None, None])
|
||||||
if subject:
|
if subject:
|
||||||
make_feed('', doc.doctype, doc.name, doc.owner, subject % doc.fields, color)
|
make_feed('', doc.doctype, doc.name, doc.owner, subject % doc.fields, color)
|
||||||
|
|
||||||
def make_comment_feed(bean, method):
|
def make_comment_feed(doc, method):
|
||||||
"""add comment to feed"""
|
"""add comment to feed"""
|
||||||
doc = bean.doc
|
|
||||||
make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by,
|
make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by,
|
||||||
'<i>"' + doc.comment + '"</i>', '#6B24B3')
|
'<i>"' + doc.comment + '"</i>', '#6B24B3')
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ def boot_session(bootinfo):
|
|||||||
load_country_and_currency(bootinfo)
|
load_country_and_currency(bootinfo)
|
||||||
|
|
||||||
bootinfo['notification_settings'] = frappe.get_doc("Notification Control",
|
bootinfo['notification_settings'] = frappe.get_doc("Notification Control",
|
||||||
"Notification Control").get_values()
|
"Notification Control")
|
||||||
|
|
||||||
# if no company, show a dialog box to create a new company
|
# if no company, show a dialog box to create a new company
|
||||||
bootinfo["customer_count"] = frappe.db.sql("""select count(*) from tabCustomer""")[0][0]
|
bootinfo["customer_count"] = frappe.db.sql("""select count(*) from tabCustomer""")[0][0]
|
||||||
|
|||||||
@@ -4,14 +4,14 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe.utils import nowtime
|
||||||
|
from frappe.utils.user import get_user_fullname
|
||||||
from erpnext.home import make_feed
|
from erpnext.home import make_feed
|
||||||
|
|
||||||
def on_session_creation(login_manager):
|
def on_session_creation(login_manager):
|
||||||
"""make feed"""
|
"""make feed"""
|
||||||
if frappe.session['user'] not in ('Guest'):
|
if frappe.session['user'] not in ('Guest'):
|
||||||
# create feed
|
# create feed
|
||||||
from frappe.utils import nowtime
|
|
||||||
from frappe.utils.user import get_user_fullname
|
|
||||||
make_feed('Login', 'User', login_manager.user, login_manager.user,
|
make_feed('Login', 'User', login_manager.user, login_manager.user,
|
||||||
'%s logged in at %s' % (get_user_fullname(login_manager.user), nowtime()),
|
'%s logged in at %s' % (get_user_fullname(login_manager.user), nowtime()),
|
||||||
login_manager.user=='Administrator' and '#8CA2B3' or '#1B750D')
|
login_manager.user=='Administrator' and '#8CA2B3' or '#1B750D')
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ def make_purchase_order_based_on_supplier(source_name, target_doc=None):
|
|||||||
if target_doc:
|
if target_doc:
|
||||||
if isinstance(target_doc, basestring):
|
if isinstance(target_doc, basestring):
|
||||||
import json
|
import json
|
||||||
target_doc = frappe.doclist(json.loads(target_doc))
|
target_doc = frappe.get_doc(json.loads(target_doc))
|
||||||
target_doc = target_doc.get({"parentfield": ["!=", "po_details"]})
|
target_doc = target_doc.get({"parentfield": ["!=", "po_details"]})
|
||||||
|
|
||||||
material_requests, supplier_items = get_material_requests_based_on_supplier(source_name)
|
material_requests, supplier_items = get_material_requests_based_on_supplier(source_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user