From 387e1e21cbe9f6379ec5836a2fcc821215d285ba Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Thu, 18 Dec 2014 11:36:23 +0530 Subject: [PATCH] add reload_doc in a few patches --- erpnext/patches/v4_1/fix_jv_remarks.py | 1 + erpnext/patches/v4_2/recalculate_bom_costs.py | 1 + 2 files changed, 2 insertions(+) diff --git a/erpnext/patches/v4_1/fix_jv_remarks.py b/erpnext/patches/v4_1/fix_jv_remarks.py index 3b2f342231..99797e10f3 100644 --- a/erpnext/patches/v4_1/fix_jv_remarks.py +++ b/erpnext/patches/v4_1/fix_jv_remarks.py @@ -6,6 +6,7 @@ import frappe def execute(): reference_date = guess_reference_date() + frappe.reload_doc('accounts', 'doctype', 'journal_voucher_detail') for name in frappe.db.sql_list("""select name from `tabJournal Voucher` where date(creation)>=%s""", reference_date): jv = frappe.get_doc("Journal Voucher", name) diff --git a/erpnext/patches/v4_2/recalculate_bom_costs.py b/erpnext/patches/v4_2/recalculate_bom_costs.py index c05fd03709..37f04131b0 100644 --- a/erpnext/patches/v4_2/recalculate_bom_costs.py +++ b/erpnext/patches/v4_2/recalculate_bom_costs.py @@ -5,6 +5,7 @@ from __future__ import unicode_literals import frappe def execute(): + frappe.reload_doc('manufacturing', 'doctype', 'bom_operation') for d in frappe.db.sql("""select bom.name from `tabBOM` bom where bom.docstatus < 2 and exists(select bom_op.name from `tabBOM Operation` bom_op where bom.name = bom_op.parent and bom_op.fixed_cycle_cost IS NOT NULL)""", as_dict=1):