[FIX]account reconciliation: filter take partner name into account if no partner defined

This commit is contained in:
Cedric Snauwaert 2014-06-17 17:10:49 +02:00 committed by qdp-odoo
parent d59a67ed88
commit f133f397b9
3 changed files with 7 additions and 2 deletions

View File

@ -590,6 +590,8 @@ class account_bank_statement_line(osv.osv):
if excluded_ids:
domain.append(('id', 'not in', excluded_ids))
if filter_str:
if not st_line.partner_id:
domain += [ '|', ('partner_id.name', 'ilike', filter_str)]
domain += ['|', ('move_id.name', 'ilike', filter_str), ('move_id.ref', 'ilike', filter_str)]
line_ids = mv_line_pool.search(cr, uid, domain, offset=offset, limit=limit, order="date_maturity asc, id asc", context=context)
return self.make_counter_part_lines(cr, uid, st_line, line_ids, count=count, context=context)

View File

@ -789,6 +789,9 @@ openerp.account = function (instance) {
line.q_amount = (line.debit !== 0 ? "- "+line.q_debit : "") + (line.credit !== 0 ? line.q_credit : "");
line.q_popover = QWeb.render("bank_statement_reconciliation_move_line_details", {line: line});
line.q_label = line.name;
if (line.has_no_partner){
line.q_label = line.partner_name + ': ' +line.q_label;
}
// WARNING : pretty much of a ugly hack
// The value of account_move.ref is either the move's communication or it's name without the slashes
@ -1039,7 +1042,7 @@ openerp.account = function (instance) {
var slice_start = self.get("pager_index") * self.max_move_lines_displayed;
var slice_end = (self.get("pager_index")+1) * self.max_move_lines_displayed;
_( _.filter(self.mv_lines_deselected, function(o){
return o.name.indexOf(self.filter) !== -1 || (o.ref && o.ref.indexOf(self.filter) !== -1)
return o.q_label.indexOf(self.filter) !== -1 || (o.ref && o.ref.indexOf(self.filter) !== -1)
})
.slice(slice_start, slice_end)).each(function(line){
var $line = $(QWeb.render("bank_statement_reconciliation_move_line", {line: line, selected: false}));

View File

@ -128,7 +128,7 @@
<td><span class="glyphicon glyphicon-add-remove"></span></td>
<td><t t-esc="line.account_code"/></td>
<td><t t-esc="line.q_due_date"/></td>
<td><t t-if="line.has_no_partner"><t t-esc="line.partner_name"/>: </t><t t-esc="line.q_label"/></td>
<td><t t-esc="line.q_label"/></td>
<td><t t-if="line.debit !== 0">
<t t-if="line.propose_partial_reconcile" t-call="icon_do_partial_reconciliation"></t>