brotherton-erpnext/erpnext/patches/v5_0/recalculate_total_amount_in_jv.py
2014-12-23 18:05:13 +05:30

15 lines
469 B
Python

# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
def execute():
for d in frappe.db.sql("""select name from `tabJournal Voucher` where docstatus < 2 """, as_dict=1):
try:
jv = frappe.get_doc('Journal Voucher', d.name)
jv.ignore_validate_update_after_submit = True
jv.set_print_format_fields()
jv.save()
frappe.db.commit()
except:
frappe.db.rollback()