From 5ffb09a5dfdee8c1b42072be8ceb3e4b90a50f3d Mon Sep 17 00:00:00 2001 From: Olivier Laurent Date: Wed, 16 Sep 2015 10:29:41 +0200 Subject: [PATCH] [FIX] account_voucher: use 'voucher' instead of 'self' in _compute_total Using 'self' triggers a ValueError: Expected singleton --- addons/account_voucher/account_voucher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 586357ffff1..8475868e8d0 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -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