From c486d9973dcd3ea327ca286fad75ca01f670827b Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 20 Apr 2016 15:08:41 +0200 Subject: [PATCH] [FIX] account: partner in compute_all The method `compute_all` in new api expects a browse record, not an id. opw-675428 --- addons/account/models/account_move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 4490302194c..28722d53e0b 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -986,8 +986,9 @@ class AccountMoveLine(models.Model): # 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')) + partner = self.env['res.partner'].browse(vals.get('partner_id')) res = taxes.compute_all(amount, - currency, 1, vals.get('product_id'), vals.get('partner_id')) + currency, 1, vals.get('product_id'), partner) # 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']