'Returns the amount of a single tax. base_amount is the actual amount on which the tax is applied, which is
price_unit * quantity eventually affected by previous taxes (if tax is include_base_amount XOR price_include)'

def _compute_amount(self, base_amount, price_unit, quantity=1.0, product=None, partner=None):

    self.ensure_one()
    if (self.amount_type == 'fixed'):
        if base_amount:
            return (math.copysign(quantity, base_amount) * self.amount)
        else:
            return (quantity * self.amount)
    if (((self.amount_type == 'percent') and (not self.price_include)) or ((self.amount_type == 'division') and self.price_include)):
        return ((base_amount * self.amount) / 100)
    if ((self.amount_type == 'percent') and self.price_include):
        return (base_amount - (base_amount / (1 + (self.amount / 100))))
    if ((self.amount_type == 'division') and (not self.price_include)):
        return ((base_amount / (1 - (self.amount / 100))) - base_amount)
