Error fixed in notification control
diff --git a/erpnext/setup/doctype/notification_control/notification_control.js b/erpnext/setup/doctype/notification_control/notification_control.js
index 32919b6..5512697 100644
--- a/erpnext/setup/doctype/notification_control/notification_control.js
+++ b/erpnext/setup/doctype/notification_control/notification_control.js
@@ -14,19 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-cur_frm.cscript.select_transaction = function(doc, dt, dn) {
+cur_frm.cscript.select_transaction = function(doc, cdt, cdn) {
if(doc.select_transaction) {
var callback = function(r,rt) {
- var doc = locals[dt][dn];
+ var doc = locals[cdt][cdn];
doc.custom_message = r.message;
refresh_field('custom_message');
}
- $c_obj('Notification Control','get_message',doc.select_transaction, callback)
+ $c_obj(make_doclist(cdt, cdn),'get_message',doc.select_transaction, callback)
}
}
cur_frm.cscript.notify = function(doc, args) {
- $c_obj('Notification Control', 'get_formatted_message', {
+ $c_obj(make_doclist(doc.doctype, doc.name), 'get_formatted_message', {
type: args['type'],
doctype: args['doctype'],
contact_name: args['contact_name'] || doc.contact_display
diff --git a/erpnext/setup/doctype/notification_control/notification_control.py b/erpnext/setup/doctype/notification_control/notification_control.py
index 9dc0076..61f5587 100644
--- a/erpnext/setup/doctype/notification_control/notification_control.py
+++ b/erpnext/setup/doctype/notification_control/notification_control.py
@@ -39,7 +39,7 @@
# set custom text
# ---------------
- def set_message(self, arg=''):
+ def set_message(self, arg = ''):
fn = self.doc.select_transaction.lower().replace(' ', '_') + '_message'
webnotes.conn.set(self.doc, fn, self.doc.custom_message)
msgprint("Custom Message for %s updated!" % self.doc.select_transaction)