summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2015-10-27 12:24:19 +0100
committerDenis Ledoux <dle@odoo.com>2015-10-27 13:29:03 +0100
commit2ec9a9c99294761e56382bdcd766e90b8bc1bb38 (patch)
tree52a43bb0fdbd28dd711ee74738fe9d304519b20b /addons
parente75314511ddc6dc6a533e265e74057442868a252 (diff)
[FIX] account: @api.v8 `account.tax`.`compute_all` expects a currency browse record
The method `compute_all` of `account.tax` in api.v8 expects a currency browse record, not a currency id. It's the `compute_all` of api.v7 that expects a currency id. opw-653106
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/account_move.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index 1975da3e732..f72e5b6bbaa 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -948,8 +948,9 @@ class AccountMoveLine(models.Model):
tax_ids = [tax['id'] for tax in self.resolve_2many_commands('tax_ids', vals['tax_ids']) if tax.get('id')]
# Since create() receives ids instead of recordset, let's just use the old-api bridge
taxes = self.env['account.tax'].browse(tax_ids)
+ currency = self.env['res.currency'].browse(vals.get('currency_id'))
res = taxes.compute_all(amount,
- vals.get('currency_id'), 1, vals.get('product_id'), vals.get('partner_id'))
+ currency, 1, vals.get('product_id'), vals.get('partner_id'))
# Adjust line amount if any tax is price_include
if abs(res['total_excluded']) < abs(amount):
if vals['debit'] != 0.0: vals['debit'] = res['total_excluded']