diff --git a/erpnext/hr/doctype/expense_voucher/expense_voucher.js b/erpnext/hr/doctype/expense_voucher/expense_voucher.js index 2e035677519..dac5543536f 100644 --- a/erpnext/hr/doctype/expense_voucher/expense_voucher.js +++ b/erpnext/hr/doctype/expense_voucher/expense_voucher.js @@ -248,7 +248,8 @@ $import(Notification Control) cur_frm.cscript.on_submit = function(doc, cdt, cdn) { var args = { type: 'Expense Voucher', - doctype: 'Expense Voucher' + doctype: 'Expense Voucher', + send_to: doc.exp_approver } cur_frm.cscript.notify(doc, args); } diff --git a/erpnext/hr/doctype/expense_voucher/expense_voucher.py b/erpnext/hr/doctype/expense_voucher/expense_voucher.py index b349100300e..a29682cf6c6 100644 --- a/erpnext/hr/doctype/expense_voucher/expense_voucher.py +++ b/erpnext/hr/doctype/expense_voucher/expense_voucher.py @@ -98,8 +98,6 @@ class DocType: set(self.doc, 'remark', self.doc.remark) set(self.doc, 'approval_status', 'Rejected') - # on approval notification - #get_obj('Notification Control').notify_contact('Expense Voucher Rejected', self.doc.doctype, self.doc.name, self.doc.email_id, self.doc.employee_name) return cstr('Rejected') @@ -157,3 +155,8 @@ class DocType: def on_cancel(self): set(self.doc, 'approval_status', 'Cancelled') + + + def get_formatted_message(self, args): + """ get formatted message for auto notification""" + return get_obj('Notification Control').get_formatted_message(args) diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index c886ec38b6b..ca248b73a6a 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -90,7 +90,8 @@ class DocType(TransactionBase): # ------------------------------------- def get_comm_rate(self, sales_partner): return get_obj('Sales Common').get_comm_rate(sales_partner, self) - + + # Clear Sales Order Details Table # -------------------------------- def clear_sales_order_details(self): diff --git a/erpnext/setup/doctype/notification_control/notification_control.py b/erpnext/setup/doctype/notification_control/notification_control.py index 61f558765f0..fabd7d8dd93 100644 --- a/erpnext/setup/doctype/notification_control/notification_control.py +++ b/erpnext/setup/doctype/notification_control/notification_control.py @@ -23,7 +23,7 @@ from webnotes.model.code import get_obj from webnotes import msgprint sql = webnotes.conn.sql - + # ----------------------------------------------------------------------------------------- # Notification control class DocType: diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index 032b52faa63..41fec67b56d 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -18,6 +18,7 @@ import webnotes from webnotes.utils import load_json, cint, cstr, flt, get_defaults from webnotes.model.doc import Document, addchild, removechild, getchildren from webnotes.model.doclist import getlist, copy_doclist +from webnotes.model.code import get_obj from webnotes import msgprint class TransactionBase: @@ -225,3 +226,8 @@ class TransactionBase: ret = webnotes.conn.sql("select default_currency from tabCompany where name = '%s'" %(name)) dcc = ret and ret[0][0] or get_defaults()['currency'] return dcc + + + def get_formatted_message(self, args): + """ get formatted message for auto notification""" + return get_obj('Notification Control').get_formatted_message(args)