diff --git a/account_move_name_sequence/post_install.py b/account_move_name_sequence/post_install.py index b4f8b997..807e4aa6 100644 --- a/account_move_name_sequence/post_install.py +++ b/account_move_name_sequence/post_install.py @@ -10,7 +10,11 @@ from odoo import SUPERUSER_ID, api def create_journal_sequences(cr, registry): with api.Environment.manage(): env = api.Environment(cr, SUPERUSER_ID, {}) - journals = env["account.journal"].with_context(active_test=False).search([]) + journals = ( + env["account.journal"] + .with_context(active_test=False) + .search([("sequence_id", "!=", False)]) + ) for journal in journals: journal_vals = { "code": journal.code,