From 0642af4150280104b4f0c6282170bc59dc1f419b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 22 Oct 2025 12:37:59 +0200 Subject: [PATCH] Do not migrate the account periods to a strict sequence if there is no sequence Closes #14308 --- modules/account/period.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/account/period.py b/modules/account/period.py index f38d4fe6cc..015e6fb041 100644 --- a/modules/account/period.py +++ b/modules/account/period.py @@ -1,6 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. +from sql import Null from sql.operators import Equal, NotEqual from trytond.cache import Cache @@ -139,7 +140,9 @@ class Period(Workflow, ModelSQL, ModelView): fiscalyear.move_sequence)) old2new.update(cursor) - cursor.execute(*t.select(t.post_move_sequence, distinct=True)) + cursor.execute(*t.select( + t.post_move_sequence, distinct=True, + where=t.post_move_sequence != Null)) for sequence_id, in cursor: if sequence_id not in old2new: sequence = Sequence(sequence_id)