brotherton-erpnext/erpnext/patches/v8_6/rename_bom_update_tool.py

9 lines
346 B
Python
Raw Normal View History

from __future__ import unicode_literals
import frappe
def execute():
frappe.delete_doc_if_exists("DocType", "BOM Replace Tool")
frappe.reload_doctype("BOM")
frappe.db.sql("update tabBOM set conversion_rate=1 where conversion_rate is null or conversion_rate=0")
frappe.db.sql("update tabBOM set set_rate_of_sub_assembly_item_based_on_bom=1")