From 11d8c5fd2e53851951abe107ed7c862f63fb1dc7 Mon Sep 17 00:00:00 2001
From: Arthur Maniet <arthurmaniet@me.com>
Date: Thu, 28 May 2015 11:22:11 +0200
Subject: [PATCH] [FIX] account bank reconciliation: - Automatic bank
 reconciliation: failure to acknowledge that x * -1 == -x - Interface: hide
 the 'partial reconciliation' sign when matching a transaction with an already
 registered payment

---
 addons/account/account_bank_statement.py                  | 4 ++--
 .../static/src/js/account_reconciliation_widgets.js       | 4 ++--
 addons/account/static/src/xml/account_reconciliation.xml  | 8 --------
 3 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py
index 866ad49c01df..9c1595274670 100644
--- a/addons/account/account_bank_statement.py
+++ b/addons/account/account_bank_statement.py
@@ -613,8 +613,8 @@ class AccountBankStatementLine(models.Model):
                 amount = aml.currency_id and aml.amount_residual_currency or aml.amount_residual
                 counterpart_aml_dicts.append({
                     'name': aml.name if aml.name != '/' else aml.move_id.name,
-                    'debit': amount < 0 and amount or 0,
-                    'credit': amount > 0 and -amount or 0,
+                    'debit': amount < 0 and -amount or 0,
+                    'credit': amount > 0 and amount or 0,
                     'move_line': aml
                 })
 
diff --git a/addons/account/static/src/js/account_reconciliation_widgets.js b/addons/account/static/src/js/account_reconciliation_widgets.js
index 86b486de48b6..4d999d6df45a 100644
--- a/addons/account/static/src/js/account_reconciliation_widgets.js
+++ b/addons/account/static/src/js/account_reconciliation_widgets.js
@@ -1640,7 +1640,7 @@ var bankStatementReconciliationLine = abstractReconciliationLine.extend({
             this.getParent().excludeMoveLines(this, this.partner_id, context.reconciliation_proposition);
 
             // This is computed on mvLinesSelectedChanged, which is not triggered  if the widget is instanciated with a reconciliation proposition
-            this.is_rapprochement = this.get("mv_lines_selected").length > 0 && this.get("mv_lines_selected")[0].is_reconciled;
+            this.is_rapprochement = this.get("mv_lines_selected").length > 0 && this.get("mv_lines_selected")[0].already_paid;
         } else {
             this.st_line = undefined;
             this.partner_id = undefined;
@@ -1942,7 +1942,7 @@ var bankStatementReconciliationLine = abstractReconciliationLine.extend({
         self.getParent().excludeMoveLines(self, self.partner_id, added_lines);
         self.getParent().unexcludeMoveLines(self, self.partner_id, removed_lines);
 
-        self.is_rapprochement = added_lines.length > 0 && added_lines[0].is_reconciled;
+        self.is_rapprochement = added_lines.length > 0 && added_lines[0].already_paid;
         if (self.is_rapprochement)
             self.set("lines_created", []);
 
diff --git a/addons/account/static/src/xml/account_reconciliation.xml b/addons/account/static/src/xml/account_reconciliation.xml
index 7fc6d2fa391f..fcb56fedc5c2 100644
--- a/addons/account/static/src/xml/account_reconciliation.xml
+++ b/addons/account/static/src/xml/account_reconciliation.xml
@@ -272,14 +272,6 @@
 
     <t t-name="icon_undo_partial_reconciliation"><i class="undo_partial_reconcile_button fa fa-exclamation-triangle" data-content="Undo the partial reconciliation."></i></t>
 
-    <t t-name="bank_statement_reconciliation_move_line_details" t-extend="reconciliation_move_line_details">
-        <t t-jquery=".details" t-operation="append">
-            <tr class="one_line_info" t-if='line.is_reconciled'>
-                <td colspan="2">This item is already reconciled</td>
-            </tr>
-        </t>
-    </t>
-
     <!-- manual reconciliation -->
 
     <t t-name="show_mode_selector_option">
-- 
GitLab