[FIX] account_payment: lin2bank correct fallback condition
authorDenis Ledoux <dle@odoo.com>
Tue, 2 Sep 2014 16:43:22 +0000 (18:43 +0200)
committerDenis Ledoux <dle@odoo.com>
Tue, 2 Sep 2014 16:43:22 +0000 (18:43 +0200)
addons/account_payment/account_move_line.py

index 35c30c6..9cc300d 100644 (file)
@@ -104,7 +104,7 @@ class account_move_line(osv.osv):
                         if bank.state in bank_type:
                             line2bank[line.id] = bank.id
                             break
-                if line.id not in line2bank and line.partner_id.bank_ids:
+                if not line2bank.get(line.id) and line.partner_id.bank_ids:
                     line2bank[line.id] = line.partner_id.bank_ids[0].id
             else:
                 raise osv.except_osv(_('Error!'), _('There is no partner defined on the entry line.'))