diff --git a/erpnext/patches.txt b/erpnext/patches.txt index b21d31b5c86..f3282f73548 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -171,3 +171,4 @@ execute:frappe.db.sql("""delete from `tabProject Task`""") erpnext.patches.v5_0.item_variants erpnext.patches.v5_0.update_item_desc_in_invoice erpnext.patches.v5_1.fix_against_account +erpnext.patches.v5_1.fix_credit_days_based_on \ No newline at end of file diff --git a/erpnext/patches/v5_1/fix_credit_days_based_on.py b/erpnext/patches/v5_1/fix_credit_days_based_on.py new file mode 100644 index 00000000000..92778180f34 --- /dev/null +++ b/erpnext/patches/v5_1/fix_credit_days_based_on.py @@ -0,0 +1,8 @@ +from __future__ import unicode_literals + +import frappe + +def execute(): + for dt in ("Customer", "Customer Group", "Company"): + frappe.db.sql("""update `tab{0}` set credit_days_based_on='Fixed Days' + where ifnull(credit_days, 0) > 0""".format(dt)) \ No newline at end of file