From 4b6c1f8de58dc93da141f17addcc2f517e7e2094 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 3 May 2012 16:26:38 +0530 Subject: [PATCH] fixes in notification control due to renaming of doctype --- .../may_2012/cleanup_notification_control.py | 28 ++++++++++ erpnext/patches/patch_list.py | 5 ++ .../notification_control.js | 3 +- .../notification_control.txt | 55 +++---------------- 4 files changed, 43 insertions(+), 48 deletions(-) create mode 100644 erpnext/patches/may_2012/cleanup_notification_control.py diff --git a/erpnext/patches/may_2012/cleanup_notification_control.py b/erpnext/patches/may_2012/cleanup_notification_control.py new file mode 100644 index 0000000000..ef652509ea --- /dev/null +++ b/erpnext/patches/may_2012/cleanup_notification_control.py @@ -0,0 +1,28 @@ +def execute(): + import webnotes + webnotes.conn.sql(""" + delete from `tabSingles` + where doctype='Notification Control' + and field in ( + 'payable_voucher', + 'payment_received_message', + 'payment_sent_message', + 'enquiry') + """) + ren_list = [ + ['expense_voucher', 'expense_claim'], + ['receivable_voucher', 'sales_invoice'], + ['enquiry', 'opportunity'], + ] + for r in ren_list: + webnotes.conn.sql(""" + update `tabSingles` + set field=%s + where field=%s + and doctype='Notification Control' + """, (r[1], r[0])) + + webnotes.conn.commit() + webnotes.conn.begin() + import webnotes.model.sync + webnotes.model.sync.sync('setup', 'notification_control') \ No newline at end of file diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index f5c98bc737..d6d689f441 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -322,5 +322,10 @@ patch_list = [ 'patch_file': 'rename_prev_doctype', 'description': 'rename prev doctype fix' }, + { + 'patch_module': 'patches.may_2012', + 'patch_file': 'cleanup_notification_control', + 'description': 'cleanup notification control' + }, ] diff --git a/erpnext/setup/doctype/notification_control/notification_control.js b/erpnext/setup/doctype/notification_control/notification_control.js index 551269789e..958ed0b012 100644 --- a/erpnext/setup/doctype/notification_control/notification_control.js +++ b/erpnext/setup/doctype/notification_control/notification_control.js @@ -37,7 +37,8 @@ cur_frm.cscript.notify = function(doc, args) { if(user!='Administrator') { return user; } else { - return (wn.control_panel.auto_email_id || 'automail@erpnext.com'); + return (wn.control_panel.auto_email_id || + 'ERPNext Notification'); } })(); if(res.send) { diff --git a/erpnext/setup/doctype/notification_control/notification_control.txt b/erpnext/setup/doctype/notification_control/notification_control.txt index 49526caed4..000902e54b 100644 --- a/erpnext/setup/doctype/notification_control/notification_control.txt +++ b/erpnext/setup/doctype/notification_control/notification_control.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:36:22', + 'creation': '2012-05-03 16:16:21', 'docstatus': 0, - 'modified': '2012-03-27 14:36:22', + 'modified': '2012-05-03 16:23:29', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -22,7 +22,7 @@ 'name': '__common__', 'section_style': u'Simple', 'server_code_error': u' ', - 'version': 79 + 'version': 1 }, # These values are common for all DocField @@ -85,16 +85,6 @@ 'width': u'50%' }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'enquiry', - 'fieldtype': u'Check', - 'hidden': 1, - 'label': u'Opportunity', - 'print_hide': 1 - }, - # DocField { 'doctype': u'DocField', @@ -122,7 +112,7 @@ # DocField { 'doctype': u'DocField', - 'fieldname': u'receivable_voucher', + 'fieldname': u'sales_invoice', 'fieldtype': u'Check', 'label': u'Sales Invoice' }, @@ -155,16 +145,7 @@ # DocField { 'doctype': u'DocField', - 'fieldname': u'payable_voucher', - 'fieldtype': u'Check', - 'label': u'Purchase Invoice', - 'print_hide': 1 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'expense_voucher', + 'fieldname': u'expense_claim', 'fieldtype': u'Check', 'label': u'Expense Claim' }, @@ -184,7 +165,7 @@ 'fieldname': u'select_transaction', 'fieldtype': u'Select', 'label': u'Select Transaction', - 'options': u'\nQuotation\nSales Order\nDelivery Note\nSales Invoice\nPayment Received\nPurchase Order\nPurchase Receipt\nPayment Sent', + 'options': u'\nQuotation\nSales Order\nDelivery Note\nSales Invoice\nPurchase Order\nPurchase Receipt\nExpense Claim\nExpense Claim Approved\nExpense Claim Rejected', 'trigger': u'Client' }, @@ -245,16 +226,6 @@ 'print_hide': 1 }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'payment_received_message', - 'fieldtype': u'Text', - 'hidden': 1, - 'label': u'Payment Received Message', - 'print_hide': 1 - }, - # DocField { 'doctype': u'DocField', @@ -278,17 +249,7 @@ # DocField { 'doctype': u'DocField', - 'fieldname': u'payment_sent_message', - 'fieldtype': u'Text', - 'hidden': 1, - 'label': u'Payment Sent Message', - 'print_hide': 1 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'expense_voucher_approved_message', + 'fieldname': u'expense_claim_approved_message', 'fieldtype': u'Text', 'hidden': 1, 'label': u'Expense Claim Approved Message', @@ -298,7 +259,7 @@ # DocField { 'doctype': u'DocField', - 'fieldname': u'expense_voucher_rejected_message', + 'fieldname': u'expense_claim_rejected_message', 'fieldtype': u'Text', 'hidden': 1, 'label': u'Expense Claim Rejected Message',