Merge pull request #6033 from nabinhait/patch_fix_10
[patch] Reload Purchase Invoice in patch. Fixed #6032
diff --git a/erpnext/patches/v7_0/repost_future_gle_for_purchase_invoice.py b/erpnext/patches/v7_0/repost_future_gle_for_purchase_invoice.py
index 3a6526c..ebc1e69 100644
--- a/erpnext/patches/v7_0/repost_future_gle_for_purchase_invoice.py
+++ b/erpnext/patches/v7_0/repost_future_gle_for_purchase_invoice.py
@@ -9,7 +9,8 @@
def execute():
if not cint(frappe.defaults.get_global_default("auto_accounting_for_stock")):
return
-
+
+ frappe.reload_doctype("Purchase Invoice")
wh_account = get_warehouse_account()
for pi in frappe.get_all("Purchase Invoice", filters={"docstatus": 1, "update_stock": 1}):