[FIX] account: partner in compute_all

The method `compute_all` in new api expects a browse record, not an id.

opw-675428
This commit is contained in:
Nicolas Martinelli
2016-04-21 08:23:33 +02:00
parent 6a473e4565
commit c486d9973d
+2 -1
View File
@@ -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']