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)
This commit is contained in:
Alexis de Lattre
2016-07-23 00:21:07 +02:00
committed by Enric Tobella
parent e158ddf7ce
commit 480d49ef79

View File

@@ -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