diff --git a/account_check_report/models/account_payment.py b/account_check_report/models/account_payment.py index 839a0072e83..d2883a87b4b 100644 --- a/account_check_report/models/account_payment.py +++ b/account_check_report/models/account_payment.py @@ -13,7 +13,7 @@ class AccountPayment(models.Model): def _compute_stat_buttons_from_reconciliation(self): res = super()._compute_stat_buttons_from_reconciliation() for rec in self: - if self.payment_type == "outbound": + if rec.payment_type == "outbound": open_action = rec.button_open_bills() result_domain = open_action.get("domain", False) if not result_domain: @@ -62,8 +62,10 @@ def get_direct_refunds(self): return invoice_ids def get_direct_refunds_domain(self): - invoice_ids = self.get_direct_refunds() - return [("id", "in", invoice_ids.ids)] + invoices = self.get_direct_refunds() + if invoices: + return [("id", "in", invoices.ids)] + return [] def button_open_invoices(self): res = super(AccountPayment, self).button_open_invoices()