From 7f18dd3b944a018bb2fe69e3173fcdff6751a983 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 15 Dec 2011 14:24:55 +0530 Subject: [PATCH] Patches for email digest and remove page break from defaults --- erpnext/patches/reload_email_digest.py | 3 +++ erpnext/patches/remove_page_break_from_defaults.py | 5 +++++ erpnext/setup/doctype/email_digest/email_digest.js | 5 +++-- erpnext/setup/doctype/email_digest/email_digest.txt | 10 +++++----- 4 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 erpnext/patches/reload_email_digest.py create mode 100644 erpnext/patches/remove_page_break_from_defaults.py diff --git a/erpnext/patches/reload_email_digest.py b/erpnext/patches/reload_email_digest.py new file mode 100644 index 00000000000..2890254eda6 --- /dev/null +++ b/erpnext/patches/reload_email_digest.py @@ -0,0 +1,3 @@ +def execute(): + from webnotes.modules.module_manager import reload_doc + reload_doc('Setup', 'DocType', 'Email Digest') diff --git a/erpnext/patches/remove_page_break_from_defaults.py b/erpnext/patches/remove_page_break_from_defaults.py new file mode 100644 index 00000000000..b565e93c736 --- /dev/null +++ b/erpnext/patches/remove_page_break_from_defaults.py @@ -0,0 +1,5 @@ +def execute(): + import webnotes + webnotes.conn.sql("""\ + DELETE FROM `tabDefaultValue` + WHERE parent='Control Panel' AND defkey='page_break'""") diff --git a/erpnext/setup/doctype/email_digest/email_digest.js b/erpnext/setup/doctype/email_digest/email_digest.js index bc2c4ba68eb..728c8b4b7d2 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.js +++ b/erpnext/setup/doctype/email_digest/email_digest.js @@ -2,6 +2,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { doc = locals[dt][dn]; var save_msg = "You must Save the form before proceeding"; var err_msg = "There was an error. One probable reason could be that you haven't saved the form. Please contact support@erpnext.com if the problem persists." + cur_frm.add_custom_button('View Now', function() { if(doc.__unsaved != 1) { $c_obj(make_doclist(dt, dn), 'get', '', function(r, rt) { @@ -41,7 +42,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { }, 1); } -cur_frm.cscript['Add Recipients'] = function(doc, dt, dn) { +cur_frm.cscript['Add/Remove Recipients'] = function(doc, dt, dn) { // Get profile list $c_obj(make_doclist(dt, dn), 'get_profiles', '', function(r, rt) { if(r.exc) { @@ -50,7 +51,7 @@ cur_frm.cscript['Add Recipients'] = function(doc, dt, dn) { // Open a dialog and display checkboxes against email addresses doc = locals[dt][dn]; var d = new wn.widgets.Dialog({ - title: 'Add Recipients', + title: 'Add/Remove Recipients', width: 400 }); var dialog_div = $a(d.body, 'div', 'dialog-div', '', ''); diff --git a/erpnext/setup/doctype/email_digest/email_digest.txt b/erpnext/setup/doctype/email_digest/email_digest.txt index 82bd7bc98ba..3d8de7b8f7a 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.txt +++ b/erpnext/setup/doctype/email_digest/email_digest.txt @@ -3,16 +3,16 @@ # These values are common in all dictionaries { - 'creation': '2011-11-28 13:11:56', + 'creation': '2011-12-12 10:41:40', 'docstatus': 0, - 'modified': '2011-12-08 19:21:26', + 'modified': '2011-12-15 13:53:08', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1323352149', + '_last_update': '1323353260', 'autoname': 'Prompt', 'colour': 'White:FFF', 'doctype': 'DocType', @@ -21,7 +21,7 @@ 'name': '__common__', 'section_style': 'Simple', 'show_in_menu': 0, - 'version': 78 + 'version': 79 }, # These values are common for all DocField @@ -145,7 +145,7 @@ { 'doctype': 'DocField', 'fieldtype': 'Button', - 'label': 'Add Recipients', + 'label': 'Add/Remove Recipients', 'permlevel': 0, 'trigger': 'Client' },