diff --git a/pos_no_cash_bank_statement/models/pos_session.py b/pos_no_cash_bank_statement/models/pos_session.py index 444be8f32d..1e634db457 100644 --- a/pos_no_cash_bank_statement/models/pos_session.py +++ b/pos_no_cash_bank_statement/models/pos_session.py @@ -23,12 +23,12 @@ def _accumulate_amounts(self, data): # I have to do that because the method # _create_cash_statement_lines_and_cash_move_lines() # reads payment_method_id.cash_journal_id - payment_methods_bank_statement = self.env["pos.payment.method"].search( - [ - ("is_cash_count", "=", False), - ("bank_statement", "=", True), - ("cash_journal_id", "!=", False), - ] + payment_methods_bank_statement = self.config_id.payment_method_ids.filtered( + lambda payment_method: ( + not payment_method.is_cash_count + and payment_method.bank_statement + and payment_method.cash_journal_id + ) ) if payment_methods_bank_statement: self.write(