fix #2847
diff --git a/erpnext/patches/v5_0/update_time_log_title.py b/erpnext/patches/v5_0/update_time_log_title.py
index c1e9112..8263be0 100644
--- a/erpnext/patches/v5_0/update_time_log_title.py
+++ b/erpnext/patches/v5_0/update_time_log_title.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
diff --git a/erpnext/setup/doctype/notification_control/notification_control.js b/erpnext/setup/doctype/notification_control/notification_control.js
index da1c7c4..409f99b 100644
--- a/erpnext/setup/doctype/notification_control/notification_control.js
+++ b/erpnext/setup/doctype/notification_control/notification_control.js
@@ -1,13 +1,19 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
-cur_frm.cscript.select_transaction = function(doc, cdt, cdn) {
- if(doc.select_transaction) {
- var callback = function(r,rt) {
- var doc = locals[cdt][cdn];
- doc.custom_message = r.message;
- refresh_field('custom_message');
- }
- return $c_obj(doc,'get_message',doc.select_transaction, callback)
- }
-}
+frappe.ui.form.on("Notification Control", {
+ select_transaction: function(frm) {
+ frm.set_value("custom_message", frm.events.get_fieldname(frm));
+ },
+ set_message: function(frm) {
+ frm.set_value(frm.events.get_fieldname(frm), frm.doc.custom_message);
+ frm.save();
+ },
+ get_fieldname: function(frm) {
+ return frm.doc.select_transaction.replace(" ", "_").toLowerCase() + "_message";
+ },
+ after_save: function(frm) {
+ // update notification settings in current session
+ frappe.boot.notification_settings = frm.doc;
+ }
+});
diff --git a/erpnext/setup/doctype/notification_control/notification_control.json b/erpnext/setup/doctype/notification_control/notification_control.json
index fe1c57d..f81801d 100644
--- a/erpnext/setup/doctype/notification_control/notification_control.json
+++ b/erpnext/setup/doctype/notification_control/notification_control.json
@@ -102,10 +102,10 @@
"permlevel": 0
},
{
- "fieldname": "update",
+ "fieldname": "set_message",
"fieldtype": "Button",
"label": "Update",
- "options": "set_message",
+ "options": "",
"permlevel": 0
},
{
@@ -176,7 +176,7 @@
"icon": "icon-envelope",
"idx": 1,
"issingle": 1,
- "modified": "2015-02-05 05:11:41.580894",
+ "modified": "2015-03-04 01:13:46.715113",
"modified_by": "Administrator",
"module": "Setup",
"name": "Notification Control",
diff --git a/erpnext/setup/doctype/notification_control/notification_control.py b/erpnext/setup/doctype/notification_control/notification_control.py
index 7eb00ce..c50baca 100644
--- a/erpnext/setup/doctype/notification_control/notification_control.py
+++ b/erpnext/setup/doctype/notification_control/notification_control.py
@@ -4,18 +4,8 @@
from __future__ import unicode_literals
import frappe
-from frappe import _
-
from frappe.model.document import Document
class NotificationControl(Document):
- def get_message(self, arg):
- fn = arg.lower().replace(' ', '_') + '_message'
- v = frappe.db.sql("select value from tabSingles where field=%s and doctype=%s", (fn, 'Notification Control'))
- return v and v[0][0] or ''
-
- def set_message(self, arg = ''):
- fn = self.select_transaction.lower().replace(' ', '_') + '_message'
- frappe.db.set(self, fn, self.custom_message)
- frappe.msgprint(_("Message updated"))
-
+ def validate(self):
+ frappe.clear_cache()
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index f64dec6..b34983d 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -728,10 +728,10 @@
},
{
"default": "No",
- "description": "Select \"Yes\" if you supply raw materials to your supplier to manufacture this item.",
+ "description": "",
"fieldname": "is_sub_contracted_item",
"fieldtype": "Select",
- "label": "Is Sub Contracted Item",
+ "label": "Supply Raw Materials for Purchase",
"oldfieldname": "is_sub_contracted_item",
"oldfieldtype": "Select",
"options": "Yes\nNo",
@@ -877,7 +877,7 @@
"icon": "icon-tag",
"idx": 1,
"max_attachments": 1,
- "modified": "2015-03-02 07:48:53.411086",
+ "modified": "2015-03-03 06:18:35.717586",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",