fix(patch): Handle NULL values from fieldtype change
This commit is contained in:
parent
c68006b607
commit
0b7da52ef1
@ -6,6 +6,10 @@ import frappe
|
|||||||
from frappe.model.utils.rename_field import rename_field
|
from frappe.model.utils.rename_field import rename_field
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
|
# updating column value to handle field change from Data to Currency
|
||||||
|
changed_field = "base_scrap_material_cost"
|
||||||
|
frappe.db.sql(f"update `tabBOM` set {changed_field} = '0' where trim(coalesce({changed_field}, ''))= ''")
|
||||||
|
|
||||||
for doctype in ['BOM Explosion Item', 'BOM Item', 'Work Order Item', 'Item']:
|
for doctype in ['BOM Explosion Item', 'BOM Item', 'Work Order Item', 'Item']:
|
||||||
if frappe.db.has_column(doctype, 'allow_transfer_for_manufacture'):
|
if frappe.db.has_column(doctype, 'allow_transfer_for_manufacture'):
|
||||||
if doctype != 'Item':
|
if doctype != 'Item':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user