'Custom lookup method for organisation rows, does a
left join with the parent organisation. Parameters
key and fields are not used, but are kept for API
compatibility reasons.
@param values: the organisation IDs'

def custom_lookup_rows(self, key, values, fields=[]):

    db = current.db
    s3db = current.s3db
    table = s3db.asset_asset
    itable = db.supply_item
    btable = db.supply_brand
    qty = len(values)
    if (qty == 1):
        query = (table.id == values[0])
        limitby = (0, 1)
    else:
        query = table.id.belongs(values)
        limitby = (0, qty)
    query &= (itable.id == table.item_id)
    rows = db(query).select(table.id, table.number, table.type, itable.name, btable.name, left=btable.on((itable.brand_id == btable.id)), limitby=limitby)
    self.queries += 1
    return rows
