chore: force reload doctype before running patch

fixes Unknown column 'against_blanket_order' in 'field list'

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
This commit is contained in:
Chinmay D. Pai 2020-04-13 16:03:22 +05:30
parent 3ea95ee451
commit de8554d0dc
No known key found for this signature in database
GPG Key ID: 75507BE256F40CED

View File

@ -1,10 +1,11 @@
import frappe
def execute():
frappe.reload_doc('selling', 'doctype', frappe.scrub('Sales Order Item'))
frappe.reload_doc('buying', 'doctype', frappe.scrub('Purchase Order Item'))
frappe.reload_doc('selling', 'doctype', 'sales_order_item', force=True)
frappe.reload_doc('buying', 'doctype', 'purchase_order_item', force=True)
for doctype in ['Sales Order Item', 'Purchase Order Item']:
for doctype in ('Sales Order Item', 'Purchase Order Item'):
frappe.db.sql("""
UPDATE `tab{0}`
SET against_blanket_order = 1