Patch for default BOM

This commit is contained in:
Neil Trini Lasrado 2015-07-15 16:39:05 +05:30
parent 0248811e53
commit 20523c45c7
2 changed files with 8 additions and 0 deletions

View File

@ -176,3 +176,4 @@ erpnext.patches.v5_1.track_operations
erpnext.patches.v5_1.sales_bom_rename
execute:frappe.rename_doc("DocType", "Salary Manager", "Process Payroll", force=True)
erpnext.patches.v5_1.rename_roles
erpnext.patches.v5_1.default_bom

View File

@ -0,0 +1,7 @@
from __future__ import unicode_literals
import frappe
def execute():
frappe.db.sql("""Update `tabItem` as item set default_bom = NULL where
not exists(select name from `tabBOM` as bom where item.default_bom = bom.name and bom.docstatus =1 )""")