Skip to content

Commit

Permalink
Merge commit 'refs/pull/114628/head' of https://github.com/odoo/odoo
Browse files Browse the repository at this point in the history
…into 16.0-2344
  • Loading branch information
docker-odoo committed May 11, 2023
2 parents 697d246 + 5c69197 commit 8cce643
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 6 additions & 2 deletions addons/account/models/account_journal.py
Expand Up @@ -263,15 +263,19 @@ def _compute_available_payment_method_ids(self):
if vals['mode'] == 'unique' and (already_used or is_protected):
continue

# Only the manual payment method can be used multiple time on a single journal.
if payment_method.code != "manual" and already_used:
# Some payment methods can be used multiple times on a single journal.
if payment_method.code not in self._get_reusable_payment_methods() and already_used:
continue

pay_method_ids_commands_x_journal[journal].append(Command.link(payment_method.id))

for journal, pay_method_ids_commands in pay_method_ids_commands_x_journal.items():
journal.available_payment_method_ids = pay_method_ids_commands

@api.model
def _get_reusable_payment_methods(self):
return {'manual'}

@api.depends('type')
def _compute_default_account_type(self):
default_account_id_types = {
Expand Down
7 changes: 7 additions & 0 deletions addons/account_check_printing/models/account_journal.py
Expand Up @@ -99,3 +99,10 @@ def action_checks_to_print(self):
default_payment_method_line_id=payment_method_line.id,
),
}

@api.model
def _get_reusable_payment_methods(self):
""" We are able to have multiple times Checks payment method in a journal """
res = super()._get_reusable_payment_methods()
res.add("check_printing")
return res

0 comments on commit 8cce643

Please sign in to comment.