2
0

[REF] account_move_name_sequence: Discard journals already configured

This commit is contained in:
Moises Lopez 2022-05-11 17:18:36 +00:00 committed by Rodrigo
parent 87f2818191
commit 52cbe647be

View File

@ -10,7 +10,11 @@ from odoo import SUPERUSER_ID, api
def create_journal_sequences(cr, registry): def create_journal_sequences(cr, registry):
with api.Environment.manage(): with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {}) 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: for journal in journals:
journal_vals = { journal_vals = {
"code": journal.code, "code": journal.code,