[FIX] account: prevent crash in account.payment
when removing the bank in an account.payment, the method _get_available_payment_method_lines() was called on an empty recordset which wasn't supported. Part-of: odoo/odoo#77122
This commit is contained in:
@@ -910,6 +910,8 @@ class AccountJournal(models.Model):
|
||||
:param payment_type: either inbound or outbound, used to know which lines to return
|
||||
:return: Either the inbound or outbound payment method lines
|
||||
"""
|
||||
if not self:
|
||||
return self.env['account.payment.method.line']
|
||||
self.ensure_one()
|
||||
if payment_type == 'inbound':
|
||||
return self.inbound_payment_method_line_ids
|
||||
|
||||
Reference in New Issue
Block a user