[FIX] account_voucher: use 'voucher' instead of 'self' in _compute_total

Using 'self' triggers a ValueError: Expected singleton
This commit is contained in:
Olivier Laurent
2015-09-16 10:31:05 +02:00
parent 03d0cac7cc
commit 5ffb09a5df
+1 -1
View File
@@ -49,7 +49,7 @@ class AccountVoucher(models.Model):
total = 0
tax_amount = 0
for line in voucher.line_ids:
tax_info = line.tax_ids.compute_all(line.price_unit, self.currency_id, line.quantity, line.product_id, voucher.partner_id)
tax_info = line.tax_ids.compute_all(line.price_unit, voucher.currency_id, line.quantity, line.product_id, voucher.partner_id)
total += tax_info.get('total_included', 0.0)
tax_amount += sum([t.get('amount',0.0) for t in tax_info.get('taxes', False)])
voucher.amount = total + voucher.tax_correction