diff --git a/addons/account/models/account_journal.py b/addons/account/models/account_journal.py index 515de5d9ba53a..a69cbf14aae1e 100644 --- a/addons/account/models/account_journal.py +++ b/addons/account/models/account_journal.py @@ -263,8 +263,8 @@ 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)) @@ -272,6 +272,10 @@ def _compute_available_payment_method_ids(self): 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 = { diff --git a/addons/account_check_printing/models/account_journal.py b/addons/account_check_printing/models/account_journal.py index 18b030f9d4828..4f94004af018c 100644 --- a/addons/account_check_printing/models/account_journal.py +++ b/addons/account_check_printing/models/account_journal.py @@ -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