From 538ff99e922239f83abb14b8117bf2fb611a1f10 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Wed, 4 Jun 2008 21:50:35 +0200 Subject: [PATCH] Fix: call compute on tax with ids instead of browse reacord. --- purchase.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/purchase.py b/purchase.py index 6621221f8a..bd59db60f5 100644 --- a/purchase.py +++ b/purchase.py @@ -188,8 +188,9 @@ class Purchase(OSV): purchase, context=context)) res.setdefault(purchase.id, Decimal('0.0')) for line in purchase.lines: - for tax in tax_obj.compute(cursor, user, line.taxes, - line.unit_price, line.quantity, context=ctx): + for tax in tax_obj.compute( + cursor, user, [t.id for t in line.taxes], line.unit_price, + line.quantity, context=ctx): res[purchase.id] += tax['amount'] res[purchase.id] = currency_obj.round(cursor, user, purchase.currency, res[purchase.id])