From 555b53602fdd7fce3ebd2b5cda971ae7f891af9d Mon Sep 17 00:00:00 2001 From: eLBati Date: Mon, 10 Oct 2016 18:11:11 +0200 Subject: [PATCH] FIX move lines preparation for bank statement reconciliation Without this, in multi currency environment, the amount shown in reconciliation widget would be incoherent: base currency and foreign currency would be mixed --- account_reconcile_payment_order/__openerp__.py | 2 +- .../models/account_bank_statement_line.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/account_reconcile_payment_order/__openerp__.py b/account_reconcile_payment_order/__openerp__.py index 84e2a80d..a9e3046d 100644 --- a/account_reconcile_payment_order/__openerp__.py +++ b/account_reconcile_payment_order/__openerp__.py @@ -19,7 +19,7 @@ ############################################################################## { "name": "Reconcile payment orders", - "version": "8.0.1.0.0", + "version": "8.0.1.0.1", "author": "Therp BV," "Serv. Tecnol. Avanzados - Pedro M. Baeza," "Odoo Community Association (OCA)", diff --git a/account_reconcile_payment_order/models/account_bank_statement_line.py b/account_reconcile_payment_order/models/account_bank_statement_line.py index 5bc3cadc..1b2c7271 100644 --- a/account_reconcile_payment_order/models/account_bank_statement_line.py +++ b/account_reconcile_payment_order/models/account_bank_statement_line.py @@ -50,6 +50,9 @@ class AccountBankStatementLine(models.Model): def get_reconcile_lines_from_order(self, this, orders, excluded_ids=None): """return lines to reconcile our statement line with""" order = orders[0] + target_currency = ( + this.currency_id or this.journal_id.currency or + this.journal_id.company_id.currency_id) if order.state == 'sent': move_lines_list = list(set(order._get_transfer_move_lines())) else: @@ -57,7 +60,9 @@ class AccountBankStatementLine(models.Model): lambda x: not x.reconcile_id) move_lines_list = [x for x in move_lines] return self.env['account.move.line']\ - .prepare_move_lines_for_reconciliation_widget(move_lines_list) + .prepare_move_lines_for_reconciliation_widget( + move_lines_list, target_currency=target_currency, + target_date=this.date) @api.model def get_reconciliation_proposition(self, this, excluded_ids=None):