projects
/
odoo
/
odoo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0a7fd6a
)
[FIX] account, bank reconciliation widget: fixed the method that manage the pager...
author
qdp-odoo
<qdp@openerp.com>
Wed, 17 Sep 2014 12:18:52 +0000
(14:18 +0200)
committer
qdp-odoo
<qdp@openerp.com>
Wed, 17 Sep 2014 12:18:52 +0000
(14:18 +0200)
addons/account/account_bank_statement.py
patch
|
blob
|
history
diff --git
a/addons/account/account_bank_statement.py
b/addons/account/account_bank_statement.py
index
7ece042
..
c606791
100644
(file)
--- a/
addons/account/account_bank_statement.py
+++ b/
addons/account/account_bank_statement.py
@@
-587,7
+587,7
@@
class account_bank_statement_line(osv.osv):
mv_line_pool = self.pool.get('account.move.line')
# Make domain
mv_line_pool = self.pool.get('account.move.line')
# Make domain
- domain = additional_domain + [('reconcile_id', '=', False),('state', '=', 'valid')]
+ domain = additional_domain + [('reconcile_id', '=', False), ('state', '=', 'valid')]
if st_line.partner_id.id:
domain += [('partner_id', '=', st_line.partner_id.id),
'|', ('account_id.type', '=', 'receivable'),
if st_line.partner_id.id:
domain += [('partner_id', '=', st_line.partner_id.id),
'|', ('account_id.type', '=', 'receivable'),
@@
-605,31
+605,30
@@
class account_bank_statement_line(osv.osv):
# Get move lines ; in case of a partial reconciliation, only consider one line
filtered_lines = []
reconcile_partial_ids = []
# Get move lines ; in case of a partial reconciliation, only consider one line
filtered_lines = []
reconcile_partial_ids = []
- shift = 0
+ actual_offset = offset
while True:
while True:
- actual_offset = offset and offset+limit*shift or offset
- actual_limit = limit and limit+limit*shift or limit
- line_ids = mv_line_pool.search(cr, uid, domain, offset=actual_offset, limit=actual_limit, order="date_maturity asc, id asc", context=context)
+ line_ids = mv_line_pool.search(cr, uid, domain, offset=actual_offset, limit=limit, order="date_maturity asc, id asc", context=context)
lines = mv_line_pool.browse(cr, uid, line_ids, context=context)
lines = mv_line_pool.browse(cr, uid, line_ids, context=context)
-
- did_filter_out_lines = False
+ make_one_more_loop = False
for line in lines:
if line.reconcile_partial_id and line.reconcile_partial_id.id in reconcile_partial_ids:
for line in lines:
if line.reconcile_partial_id and line.reconcile_partial_id.id in reconcile_partial_ids:
- did_filter_out_lines = True
+ #if we filtered a line because it is partially reconciled with an already selected line, we must do one more loop
+ #in order to get the right number of items in the pager
+ make_one_more_loop = True
continue
filtered_lines.append(line)
if line.reconcile_partial_id:
reconcile_partial_ids.append(line.reconcile_partial_id.id)
continue
filtered_lines.append(line)
if line.reconcile_partial_id:
reconcile_partial_ids.append(line.reconcile_partial_id.id)
-
- if not limit or not did_filter_out_lines or len(filtered_lines) >= limit:
+
+ if not limit or not make_one_more_loop or len(filtered_lines) >= limit:
break
break
- shift += 1
+ actual_offset = actual_offset + limit
lines = limit and filtered_lines[:limit] or filtered_lines
# Either return number of lines
if count:
return len(lines)
lines = limit and filtered_lines[:limit] or filtered_lines
# Either return number of lines
if count:
return len(lines)
-
+
# Or return list of dicts representing the formatted move lines
else:
target_currency = st_line.currency_id or st_line.journal_id.currency or st_line.journal_id.company_id.currency_id
# Or return list of dicts representing the formatted move lines
else:
target_currency = st_line.currency_id or st_line.journal_id.currency or st_line.journal_id.company_id.currency_id