From 5aee7d1b7072d9aa8299e4f63184a0248492c307 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 15 Jun 2017 15:35:08 +0530 Subject: [PATCH 1/3] Change column length of in_words --- erpnext/patches.txt | 1 + .../v8_0/change_in_words_varchar_length.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 erpnext/patches/v8_0/change_in_words_varchar_length.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index e52ce5eb03..3796c8293c 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -400,3 +400,4 @@ erpnext.patches.v8_0.delete_schools_depricated_doctypes erpnext.patches.v8_0.update_customer_pos_id erpnext.patches.v8_0.rename_items_in_status_field_of_material_request erpnext.patches.v8_0.delete_bin_indexes +erpnext.patches.v8_0.change_in_words_varchar_length \ No newline at end of file diff --git a/erpnext/patches/v8_0/change_in_words_varchar_length.py b/erpnext/patches/v8_0/change_in_words_varchar_length.py new file mode 100644 index 0000000000..0e5891ea6f --- /dev/null +++ b/erpnext/patches/v8_0/change_in_words_varchar_length.py @@ -0,0 +1,16 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe + +def execute(): + doctypes = frappe.db.sql_list(""""select parent from tabDocField where fieldname = 'in_words'""") + + for dt in doctypes: + for fieldname in ("in_words", "base_in_words"): + frappe.db.sql("alter table `tab{0}` change column `{1}` `{2}` varchar(255)" + .format(dt, fieldname, fieldname)) + + frappe.db.sql("""alter table `tabJournal Entry` + change column `total_amount_in_words` `total_amount_in_words` varchar(255)""") \ No newline at end of file From a4af7cb7d3900e9f7724f916afb65800eb2e7b11 Mon Sep 17 00:00:00 2001 From: Makarand Bauskar Date: Thu, 15 Jun 2017 16:02:44 +0530 Subject: [PATCH 2/3] removed extra quote from query --- erpnext/patches/v8_0/change_in_words_varchar_length.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/patches/v8_0/change_in_words_varchar_length.py b/erpnext/patches/v8_0/change_in_words_varchar_length.py index 0e5891ea6f..68ff95b5ed 100644 --- a/erpnext/patches/v8_0/change_in_words_varchar_length.py +++ b/erpnext/patches/v8_0/change_in_words_varchar_length.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe def execute(): - doctypes = frappe.db.sql_list(""""select parent from tabDocField where fieldname = 'in_words'""") + doctypes = frappe.db.sql_list("""select parent from tabDocField where fieldname = 'in_words'""") for dt in doctypes: for fieldname in ("in_words", "base_in_words"): @@ -13,4 +13,4 @@ def execute(): .format(dt, fieldname, fieldname)) frappe.db.sql("""alter table `tabJournal Entry` - change column `total_amount_in_words` `total_amount_in_words` varchar(255)""") \ No newline at end of file + change column `total_amount_in_words` `total_amount_in_words` varchar(255)""") From 489550ed59ddfa9c2fa9aeacb8d9efa49a795034 Mon Sep 17 00:00:00 2001 From: mbauskar Date: Thu, 15 Jun 2017 16:35:49 +0600 Subject: [PATCH 3/3] bumped to version 8.0.50 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index a466446f0c..a6b5b7206b 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '8.0.49' +__version__ = '8.0.50' def get_default_company(user=None):