From 8f04d119bbc4698db6e7f55e15334a57d282b2c8 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 2 Sep 2013 17:39:59 +0530 Subject: [PATCH] [communication] [minor --- patches/patch_list.py | 1 + patches/september_2013/__init__.py | 0 patches/september_2013/p01_update_communication.py | 10 ++++++++++ selling/doctype/lead/lead.txt | 6 +++--- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 patches/september_2013/__init__.py create mode 100644 patches/september_2013/p01_update_communication.py diff --git a/patches/patch_list.py b/patches/patch_list.py index 1d382a56bd..b515339b49 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -257,4 +257,5 @@ patch_list = [ "execute:webnotes.reload_doc('accounts', 'Print Format', 'POS Invoice') # 2013-08-16", "patches.august_2013.p06_fix_sle_against_stock_entry", "execute:webnotes.bean('Style Settings').save() #2013-08-20", + "patches.september_2013.p01_update_communication" ] \ No newline at end of file diff --git a/patches/september_2013/__init__.py b/patches/september_2013/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/patches/september_2013/p01_update_communication.py b/patches/september_2013/p01_update_communication.py new file mode 100644 index 0000000000..c3bd61b402 --- /dev/null +++ b/patches/september_2013/p01_update_communication.py @@ -0,0 +1,10 @@ +import webnotes + +def execute(): + for doctype in ("Contact", "Lead", "Job Applicant", "Supplier", "Customer", "Quotation", "Sales Person", "Support Ticket"): + fieldname = doctype.replace(" ", '_').lower() + webnotes.conn.sql("""update tabCommunication + set parenttype=%s, parentfield='communications', + parent=`%s` + where ifnull(`%s`, '')!=''""" % ("%s", fieldname, fieldname), doctype) + \ No newline at end of file diff --git a/selling/doctype/lead/lead.txt b/selling/doctype/lead/lead.txt index 156b61ec7b..9402259ac7 100644 --- a/selling/doctype/lead/lead.txt +++ b/selling/doctype/lead/lead.txt @@ -2,7 +2,7 @@ { "creation": "2013-04-10 11:45:37", "docstatus": 0, - "modified": "2013-09-02 16:16:14", + "modified": "2013-09-02 17:25:59", "modified_by": "Administrator", "owner": "Administrator" }, @@ -412,10 +412,10 @@ }, { "doctype": "DocField", - "fieldname": "communcations", + "fieldname": "communications", "fieldtype": "Table", "hidden": 1, - "label": "Communcations", + "label": "Communications", "options": "Communication" }, {