'Returns all information required to apply taxes (in self + their children in case of a tax goup).
We consider the sequence of the parent for group of taxes.
Eg. considering letters as taxes and alphabetic order as sequence :
[G, B([A, D, F]), E, C] will be computed as [A, D, F, C, E, G]
RETURN: {
\'total_excluded\': 0.0,    # Total without taxes
\'total_included\': 0.0,    # Total with taxes
\'taxes\': [{               # One dict for each tax in self and their children
\'id\': int,
\'name\': str,
\'amount\': float,
\'sequence\': int,
\'account_id\': int,
\'refund_account_id\': int,
\'analytic\': boolean,'

@api.multi
def compute_all(self, price_unit, currency=None, quantity=1.0, product=None, partner=None):

    if (len(self) == 0):
        company_id = self.env.user.company_id
    else:
        company_id = self[0].company_id
    if (not currency):
        currency = company_id.currency_id
    taxes = []
    prec = currency.decimal_places
    round_tax = (False if (company_id.tax_calculation_rounding_method == 'round_globally') else True)
    round_total = True
    if ('round' in self.env.context):
        round_tax = bool(self.env.context['round'])
        round_total = bool(self.env.context['round'])
    if (not round_tax):
        prec += 5
    base_values = self.env.context.get('base_values')
    if (not base_values):
        total_excluded = total_included = base = round((price_unit * quantity), prec)
    else:
        (total_excluded, total_included, base) = base_values
    for tax in self.sorted(key=(lambda r: r.sequence)):
        if (tax.amount_type == 'group'):
            children = tax.children_tax_ids.with_context(base_values=(total_excluded, total_included, base))
            ret = children.compute_all(price_unit, currency, quantity, product, partner)
            total_excluded = ret['total_excluded']
            base = (ret['base'] if tax.include_base_amount else base)
            total_included = ret['total_included']
            tax_amount = (total_included - total_excluded)
            taxes += ret['taxes']
            continue
        tax_amount = tax._compute_amount(base, price_unit, quantity, product, partner)
        if (not round_tax):
            tax_amount = round(tax_amount, prec)
        else:
            tax_amount = currency.round(tax_amount)
        if tax.price_include:
            total_excluded -= tax_amount
            base -= tax_amount
        else:
            total_included += tax_amount
        tax_base = base
        if tax.include_base_amount:
            base += tax_amount
        taxes.append({'id': tax.id, 'name': tax.with_context(**({'lang': partner.lang} if partner else {})).name, 'amount': tax_amount, 'base': tax_base, 'sequence': tax.sequence, 'account_id': tax.account_id.id, 'refund_account_id': tax.refund_account_id.id, 'analytic': tax.analytic})
    return {'taxes': sorted(taxes, key=(lambda k: k['sequence'])), 'total_excluded': (currency.round(total_excluded) if round_total else total_excluded), 'total_included': (currency.round(total_included) if round_total else total_included), 'base': base}
