'Recommend a new quantity and raise a validation exception'

def recommend_new_qty(self, item, ps_item_qty, no_of_cases):

    item[u'recommended_qty'] = ((flt(item[u'qty']) - flt(item[u'packed_qty'])) / no_of_cases)
    item[u'specified_qty'] = flt(ps_item_qty[item[u'item_code']])
    if (not item[u'packed_qty']):
        item[u'packed_qty'] = 0
    frappe.throw(_(u'Quantity    for    Item    {0}    must    be    less    than    {1}').format(item.get(u'item_code'), item.get(u'recommended_qty')))
