[solved] Erpnext.patches.v7_0.update_item_projected error

The following error is observed when patching. I think when the item is not in tabBin the total_projected_qty will be null.
_mysql_exceptions.OperationalError: (1048, "Column 'total_projected_qty' cannot be null")

might i suggest the following for /erpnext/stock/doctype/bin/bin.py?

def update_item_projected_qty(item_code):
	import logging
	'''Set Item project qty'''
	frappe.db.sql('''update tabItem set
		total_projected_qty = ifnull((select sum(projected_qty) from tabBin where item_code=%s), 0)
		where name=%s''', (item_code, item_code))
1 Like

Thanks fixed.