[FIX] account: fixed the proposal of reconciliation in the bank statement for negative amounts

This commit is contained in:
qdp-odoo 2014-06-18 14:37:29 +02:00
parent 59b47119c8
commit bc05fe262c
1 changed files with 5 additions and 5 deletions

View 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