Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][IMP] pos_no_cash_bank_statement: Filter payment methods configured in the POS. #1005

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pos_no_cash_bank_statement/models/pos_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down