diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index a2e73bbab01..b1d8012329d 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -256,11 +256,13 @@ class account_payment(models.Model): self.partner_type = 'customer' elif self.payment_type == 'outbound': self.partner_type = 'supplier' + else: + self.partner_type = False # Set payment method domain res = self._onchange_journal() if not res.get('domain', {}): res['domain'] = {} - res['domain']['journal_id'] = self.payment_type == 'inbound' and [('at_least_one_inbound', '=', True)] or [('at_least_one_outbound', '=', True)] + res['domain']['journal_id'] = self.payment_type == 'inbound' and [('at_least_one_inbound', '=', True)] or self.payment_type == 'outbound' and [('at_least_one_outbound', '=', True)] or [] res['domain']['journal_id'].append(('type', 'in', ('bank', 'cash'))) return res