From 596e36d51110e6f84e10a111c22a9b419ca5007b Mon Sep 17 00:00:00 2001 From: Javi Melendez Date: Mon, 25 Apr 2016 09:48:15 +0200 Subject: [PATCH] contract_payment_mode: get bank account from partner (#30) in recurring invoice --- contract_payment_mode/models/contract.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contract_payment_mode/models/contract.py b/contract_payment_mode/models/contract.py index 0aa60e89..1d255667 100644 --- a/contract_payment_mode/models/contract.py +++ b/contract_payment_mode/models/contract.py @@ -26,7 +26,8 @@ class AccountAnalyticAccount(models.Model): _prepare_invoice_data(contract) if contract.payment_mode_id: invoice_vals['payment_mode_id'] = contract.payment_mode_id.id - invoice_vals['partner_bank_id'] = \ - contract.payment_mode_id.bank_id.id + invoice_vals['partner_bank_id'] = ( + contract.partner_id.bank_ids[:1].id or + contract.payment_mode_id.bank_id.id) return invoice_vals