[FIX] account: account_invoice's onchange_partner_id uses the first partner bank...
authorArthur Maniet <ama@odoo.com>
Tue, 16 Sep 2014 11:36:36 +0000 (13:36 +0200)
committerqdp-odoo <qdp@openerp.com>
Tue, 16 Sep 2014 11:37:51 +0000 (13:37 +0200)
addons/account/account_invoice.py

index d25a539..a0ecec6 100644 (file)
@@ -449,7 +449,7 @@ class account_invoice(models.Model):
                 account_id = pay_account.id
                 payment_term_id = p.property_supplier_payment_term.id
             fiscal_position = p.property_account_position.id
-            bank_id = p.bank_ids.id
+            bank_id = p.bank_ids and p.bank_ids[0].id or False
 
         result = {'value': {
             'account_id': account_id,