From 480d49ef79d44663c49cc9b69d25ed82edf72bb2 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 23 Jul 2016 00:21:07 +0200 Subject: [PATCH] FIX crash when selecting a customer that has a direct debit payment mode but no mandate Hide many fields when payment_order_ok is False on a payment_mode Fix payment line communication when the move line is not linked to an invoice (problem found when porting donation_debit_debit to v9) --- account_banking_mandate/models/account_invoice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/account_banking_mandate/models/account_invoice.py b/account_banking_mandate/models/account_invoice.py index 140a78229..d821ee3e2 100644 --- a/account_banking_mandate/models/account_invoice.py +++ b/account_banking_mandate/models/account_invoice.py @@ -59,7 +59,8 @@ class AccountInvoice(models.Model): ('state', '=', 'valid'), ('partner_id', '=', self.commercial_partner_id.id), ]) - self.mandate_id = mandates[0] + if mandates: + self.mandate_id = mandates[0] else: self.mandate_id = False