From ceb033ae9377507da666c7e9f04cb3319ed91234 Mon Sep 17 00:00:00 2001 From: Jose Zambudio Date: Wed, 31 May 2023 08:56:50 +0200 Subject: [PATCH] [IMP] Filter payment methods configured in the POS. --- pos_no_cash_bank_statement/models/pos_session.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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(