[FIX] account: retrieve bank statement for process_reconciliation

Multicurrency is ON
Your company in USD

Make a bank journal in EUR
Create a statement and push reconcile

In the widget, create a line with a tax and hit reconcile

Before this commit, the amount_currency field of the tax move line was not filled

After this commit it is

OPW 1885014

closes odoo/odoo#27592
This commit is contained in:
Lucas Perais (lpe)
2018-10-10 14:56:56 +00:00
parent 717f458394
commit 721260d2a7
+1 -1
View File
@@ -1306,7 +1306,7 @@ class AccountMoveLine(models.Model):
'credit': tax_vals['amount'] < 0 and -tax_vals['amount'] or 0.0,
'analytic_account_id': vals.get('analytic_account_id') if tax.analytic else False,
}
bank = self.env["account.bank.statement"].browse(vals.get('statement_id'))
bank = self.env["account.bank.statement.line"].browse(vals.get('statement_line_id')).statement_id
if bank.currency_id != bank.company_id.currency_id:
ctx = {}
if 'date' in vals: