From 60aecd87b145921c15524f802ab1a04b1c88ae6d Mon Sep 17 00:00:00 2001 From: tunde Date: Mon, 4 Sep 2017 19:40:31 +0100 Subject: [PATCH] fix bugs in patches --- erpnext/patches/v8_10/add_due_date_to_gle.py | 2 +- erpnext/patches/v8_10/add_payment_terms_field_to_supplier.py | 4 ++-- erpnext/patches/v8_10/change_default_customer_credit_days.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/patches/v8_10/add_due_date_to_gle.py b/erpnext/patches/v8_10/add_due_date_to_gle.py index 047c883f0f..ec5e003cb9 100644 --- a/erpnext/patches/v8_10/add_due_date_to_gle.py +++ b/erpnext/patches/v8_10/add_due_date_to_gle.py @@ -4,4 +4,4 @@ import frappe def execute(): if not frappe.db.has_column("GL Entry", "due_date"): - frappe.db.sql("ALTER TABLE `tabGL Entry` ADD COLUMN `due_date` DATE DEFAULT NULL") + frappe.db.sql("ALTER TABLE `tabGL Entry` ADD COLUMN `due_date` DATE NULL") diff --git a/erpnext/patches/v8_10/add_payment_terms_field_to_supplier.py b/erpnext/patches/v8_10/add_payment_terms_field_to_supplier.py index c5a6fb1942..b507b2aabb 100644 --- a/erpnext/patches/v8_10/add_payment_terms_field_to_supplier.py +++ b/erpnext/patches/v8_10/add_payment_terms_field_to_supplier.py @@ -4,6 +4,6 @@ import frappe def execute(): if not frappe.db.has_column("Customer", "payment_terms"): - frappe.db.sql("ALTER TABLE `tabCustomer` ADD COLUMN `payment_terms` DATE DEFAULT NULL") + frappe.db.sql("ALTER TABLE `tabCustomer` ADD COLUMN `payment_terms` VARCHAR(140) NULL") if not frappe.db.has_column("Supplier", "payment_terms"): - frappe.db.sql("ALTER TABLE `tabSupplier` ADD COLUMN `payment_terms` DATE DEFAULT NULL") + frappe.db.sql("ALTER TABLE `tabSupplier` ADD COLUMN `payment_terms` VARCHAR(140) NULL") diff --git a/erpnext/patches/v8_10/change_default_customer_credit_days.py b/erpnext/patches/v8_10/change_default_customer_credit_days.py index c4376fa974..dc52c89f45 100644 --- a/erpnext/patches/v8_10/change_default_customer_credit_days.py +++ b/erpnext/patches/v8_10/change_default_customer_credit_days.py @@ -55,7 +55,7 @@ def execute(): value_query_str = " ".join(payment_terms) cond_query_str = " ELSE `payment_terms` END WHERE " - if customers: + if suppliers: frappe.db.sql( begin_query_str + value_query_str + cond_query_str + '`supplier_name` IN %s', (suppliers,)