From 52cbe647be1a1ef1881e693bc1a1932a0550ac13 Mon Sep 17 00:00:00 2001 From: Moises Lopez Date: Wed, 11 May 2022 17:18:36 +0000 Subject: [PATCH] [REF] account_move_name_sequence: Discard journals already configured --- account_move_name_sequence/post_install.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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,