[patch] Set 'Credit days based on' in existing customer, customer group and company

This commit is contained in:
Nabin Hait 2015-07-09 17:49:50 +05:30
parent 40e92b679b
commit 0724449d0e
2 changed files with 9 additions and 0 deletions

View File

@ -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

View File

@ -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))