diff --git a/addons/account/wizard/account_resequence.py b/addons/account/wizard/account_resequence.py index a3d60d37f06..2e5016b25bb 100644 --- a/addons/account/wizard/account_resequence.py +++ b/addons/account/wizard/account_resequence.py @@ -138,7 +138,11 @@ class ReSequenceWizard(models.TransientModel): if self.move_ids.journal_id and self.move_ids.journal_id.restrict_mode_hash_table: if self.ordering == 'date': raise UserError(_('You can not reorder sequence by date when the journal is locked with a hash.')) - self.env['account.move'].browse(int(k) for k in new_values.keys()).name = False + moves_to_rename = self.env['account.move'].browse(int(k) for k in new_values.keys()) + moves_to_rename.name = '/' + moves_to_rename.flush_recordset(["name"]) + # If the db is not forcibly updated, the temporary renaming could only happen in cache and still trigger the constraint + for move_id in self.move_ids: if str(move_id.id) in new_values: if self.ordering == 'keep':