brotherton-erpnext/erpnext/patches/v9_0/copy_old_fees_field_data.py

12 lines
368 B
Python
Raw Normal View History

# Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
2017-10-27 11:55:15 +05:30
frappe.reload_doctype('Fees')
if "total_amount" not in frappe.db.get_table_columns("Fees"):
return
frappe.db.sql("""update tabFees set grand_total=total_amount where grand_total = 0.0""")