Fixed issie in auto notification
diff --git a/erpnext/hr/doctype/expense_voucher/expense_voucher.js b/erpnext/hr/doctype/expense_voucher/expense_voucher.js
index 2e03567..dac5543 100644
--- a/erpnext/hr/doctype/expense_voucher/expense_voucher.js
+++ b/erpnext/hr/doctype/expense_voucher/expense_voucher.js
@@ -248,7 +248,8 @@
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 b349100..a29682c 100644
--- a/erpnext/hr/doctype/expense_voucher/expense_voucher.py
+++ b/erpnext/hr/doctype/expense_voucher/expense_voucher.py
@@ -98,8 +98,6 @@
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 @@
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 c886ec3..ca248b7 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -90,7 +90,8 @@
# -------------------------------------
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 61f5587..fabd7d8 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 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 032b52f..41fec67 100644
--- a/erpnext/utilities/transaction_base.py
+++ b/erpnext/utilities/transaction_base.py
@@ -18,6 +18,7 @@
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 @@
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)