[FIX] account: bank statement reconciliation widget: correctly refresh partial reconc...
authorArthur Maniet <ama@odoo.com>
Thu, 11 Sep 2014 07:27:10 +0000 (09:27 +0200)
committerArthur Maniet <ama@odoo.com>
Thu, 11 Sep 2014 07:27:10 +0000 (09:27 +0200)
addons/account/static/src/js/account_widgets.js

index 86f5b25..eb07489 100644 (file)
@@ -1452,9 +1452,16 @@ openerp.account = function (instance) {
             self.set("balance", balance);
     
             // Propose partial reconciliation if necessary
-            if (lines_selected_num === 1 && self.st_line.amount * balance > 0 && ! mv_lines_selected[0].partial_reconcile) {
+            if (lines_selected_num === 1 &&
+                self.st_line.amount * balance > 0 &&
+                self.st_line.amount * (mv_lines_selected[0].debit - mv_lines_selected[0].credit) < 0 &&
+                ! mv_lines_selected[0].partial_reconcile) {
+                
                 mv_lines_selected[0].propose_partial_reconcile = true;
                 self.updateAccountingViewMatchedLines();
+            } else if (lines_selected_num === 1) {
+                mv_lines_selected[0].propose_partial_reconcile = false;
+                self.updateAccountingViewMatchedLines();
             }
         },