diff --git a/period.py b/period.py index 69f41f7dde..a92fa62747 100644 --- a/period.py +++ b/period.py @@ -302,8 +302,9 @@ class Period(Workflow, ModelSQL, ModelView): database = transaction.database connection = transaction.connection - # Lock period to be sure no new period will be created in between. + # Lock period and move to be sure no new record will be created database.lock(connection, JournalPeriod._table) + database.lock(connection, Move._table) unposted_moves = Move.search([ ('period', 'in', [p.id for p in periods]),