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
logging.basicConfig(filename='/tmp/example.log',level=logging.DEBUG)
logging.debug(item_code)
'''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.