'Enables check printing payment method and add a check sequence on bank journals.
Called upon module installation via data file.'

@api.model
def _enable_check_printing_on_bank_journals(self):

    check_printing = self.env.ref('account_check_printing.account_payment_method_check')
    bank_journals = self.search([('type', '=', 'bank')])
    for bank_journal in bank_journals:
        bank_journal._create_check_sequence()
        bank_journal.write({'outbound_payment_method_ids': [(4, check_printing.id, None)]})
