'Callback to add the total in stock for the selected item.
This can then be used to look at the value before and after
to ensure that the totals have been removed from the warehouse.
The stock row will be added to the *end* of the list of rows'

def dbcallback_getStockLevels(self, table, data, rows):

    table = current.s3db['inv_inv_item']
    inv_item_id = None
    for details in data:
        if (details[0] == 'send_inv_item_id'):
            inv_item_id = details[1]
            break
    if inv_item_id:
        stock_row = table[inv_item_id]
        rows.records.append(stock_row)
    return rows
