add reload_doc in a few patches
diff --git a/erpnext/patches/v4_1/fix_jv_remarks.py b/erpnext/patches/v4_1/fix_jv_remarks.py
index 3b2f342..99797e1 100644
--- a/erpnext/patches/v4_1/fix_jv_remarks.py
+++ b/erpnext/patches/v4_1/fix_jv_remarks.py
@@ -6,6 +6,7 @@
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 c05fd03..37f0413 100644
--- a/erpnext/patches/v4_2/recalculate_bom_costs.py
+++ b/erpnext/patches/v4_2/recalculate_bom_costs.py
@@ -5,6 +5,7 @@
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):