'Transforms a list of order lines into a dict for google analytics'

def order_lines_2_google_api(self, order_lines):

    ret = []
    for line in order_lines:
        product = line.product_id
        ret.append({'id': line.order_id.id, 'sku': (product.barcode or product.id), 'name': (product.name or '-'), 'category': (product.categ_id.name or '-'), 'price': line.price_unit, 'quantity': line.product_uom_qty})
    return ret
