fix bugs in patches

This commit is contained in:
tunde 2017-09-04 19:40:31 +01:00
parent 4e4a40e46b
commit 60aecd87b1
3 changed files with 4 additions and 4 deletions

View File

@ -4,4 +4,4 @@ import frappe
def execute(): def execute():
if not frappe.db.has_column("GL Entry", "due_date"): 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")

View File

@ -4,6 +4,6 @@ import frappe
def execute(): def execute():
if not frappe.db.has_column("Customer", "payment_terms"): 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"): 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")

View File

@ -55,7 +55,7 @@ def execute():
value_query_str = " ".join(payment_terms) value_query_str = " ".join(payment_terms)
cond_query_str = " ELSE `payment_terms` END WHERE " cond_query_str = " ELSE `payment_terms` END WHERE "
if customers: if suppliers:
frappe.db.sql( frappe.db.sql(
begin_query_str + value_query_str + cond_query_str + '`supplier_name` IN %s', begin_query_str + value_query_str + cond_query_str + '`supplier_name` IN %s',
(suppliers,) (suppliers,)