grouped_data = {}
have_to_group_by = session and session.config_id.group_by or False
- def compute_tax(amount, tax, line):
- if amount > 0:
- tax_code_id = tax['base_code_id']
- tax_amount = line.price_subtotal * tax['base_sign']
- else:
- tax_code_id = tax['ref_base_code_id']
- tax_amount = line.price_subtotal * tax['ref_base_sign']
-
- return (tax_code_id, tax_amount,)
-
for order in self.browse(cr, uid, ids, context=context):
if order.account_move:
continue
tax_amount = 0
while computed_taxes:
tax = computed_taxes.pop(0)
- tax_code_id, tax_amount = compute_tax(amount, tax, line)
+ tax_code_id, tax_amount = super(sale_order, self).compute_tax(amount, tax, line)
# If there is one we stop
if tax_code_id:
# For each remaining tax with a code, whe create a move line
for tax in computed_taxes:
- tax_code_id, tax_amount = compute_tax(amount, tax, line)
+ tax_code_id, tax_amount = super(sale_order, self).compute_tax(amount, tax, line)
if not tax_code_id:
continue