[FIX] account: fixed the proposal of reconciliation in the bank statement for negativ...
authorqdp-odoo <qdp@openerp.com>
Wed, 18 Jun 2014 12:37:29 +0000 (14:37 +0200)
committerqdp-odoo <qdp@openerp.com>
Fri, 20 Jun 2014 08:01:35 +0000 (10:01 +0200)
addons/account/account_bank_statement.py

index 99a869c..1ddab4b 100644 (file)
@@ -409,6 +409,10 @@ class account_bank_statement(osv.osv):
             'domain':[('statement_id','in',ids)],
             'context':ctx,
         }
+
+    def number_of_lines_reconciled(self, cr, uid, id, context=None):
+        bsl_obj = self.pool.get('account.bank.statement.line')
+        return bsl_obj.search_count(cr, uid, [('statement_id', '=', id), ('journal_entry_id', '!=', False)], context=context)
         
     def get_format_currency_js_function(self, cr, uid, id, context=None):
         """ Returns a string that can be used to instanciate a javascript function.
@@ -432,10 +436,6 @@ class account_bank_statement(osv.osv):
                 done_currencies.append(st_line_currency.id)
         return function
 
-    def number_of_lines_reconciled(self, cr, uid, id, context=None):
-        bsl_obj = self.pool.get('account.bank.statement.line')
-        return bsl_obj.search_count(cr, uid, [('statement_id', '=', id), ('journal_entry_id', '!=', False)], context=context)
-
     def link_bank_to_partner(self, cr, uid, ids, context=None):
         for statement in self.browse(cr, uid, ids, context=context):
             for st_line in statement.line_ids:
@@ -554,7 +554,7 @@ class account_bank_statement_line(osv.osv):
             if total + line[amount_field] <= abs(st_line.amount):
                 ret.append(line)
                 total += line[amount_field]
-            if total >= st_line.amount:
+            if total >= abs(st_line.amount):
                 break
         return ret