'Total weight of a track item'

@staticmethod
def inv_track_item_total_weight(row, received=False):

    if hasattr(row, 'inv_track_item'):
        row = row.inv_track_item
    try:
        table = current.s3db.supply_item
        item = current.db((table.id == row.item_id)).select(table.weight, limitby=(0, 1)).first()
        quantity = (row.quantity if (not received) else row.recv_quantity)
        if (not quantity):
            quantity = 0
        return (quantity * item.weight)
    except:
        return current.messages['NONE']
