Skip to main content
iVentureTeam

account_resequence_widget

Renumbering posted journal entries is not something you want to guess at. This widget draws the before and after list so the wizard can be read before it is run.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 27, 2026Updated August 27, 20265 min read
Technical nameaccount_resequence_widget
Field typestext
Viewsform
Moduleaccount, present wherever Invoicing or Accounting is installed
Used in core1 occurrence, the resequence wizard in account
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0
No-code setupNo. The preview payload has to be computed server side
Alternativesgrouped_view_widget, account_batch_sending_summary, html, open_move_widget

What the resequence preview does

Journal entry numbers are supposed to be a gapless, ordered sequence, and occasionally they are not: entries posted out of order, a sequence changed mid-year, a batch imported with the wrong prefix. Odoo has a wizard that renumbers a selection of entries to fix that.

Renumbering posted accounting documents is a serious action, so the wizard shows exactly what it is about to do before you confirm. This widget is that preview: a list of the affected entries with their current number and the number they will get, in the order the renumbering will apply.

It reads that list from a text field holding a JSON string, computed by the wizard. Nothing on the panel is editable and nothing is clickable; the options that change the outcome are the other fields on the wizard, and the preview redraws as they change.

What this means for your team

The reason to show a preview at all is that the operation is hard to reverse and easy to misjudge. Renumbering the wrong range, or renumbering with the wrong ordering, produces a set of accounting documents whose numbers no longer match anything a customer or an auditor has seen. A visible before and after list turns that from a leap of faith into a check.

Sequence integrity matters differently by country. In jurisdictions that require gapless numbering, being able to correct a sequence and show what was corrected is part of staying compliant. In others it is housekeeping. Either way the person clicking confirm should be able to read the consequence, which is what this widget is for.

Working examples

The core usage

<field name="preview_moves"
       widget="account_resequence_widget"
       nolabel="1" colspan="2"/>

No options and no label. The wizard's other fields, such as the ordering choice, drive what the preview contains.

The payload shape

{
  "ordering": "date",
  "changeLines": [
    {"new_by_name": "INV/2026/0007",
     "new_by_date": "INV/2026/0005",
     "current_name": "INV/2026/0011",
     "date": "2026-03-14"}
  ]
}

An object, not an array. The ordering key is what the renderer uses to decide which of the proposed numbers to show.

A fresh wizard

# field empty -> the widget renders
{ "changeLines": [], "ordering": "date" }

The fallback is built into the getter, so an unset field produces an empty panel rather than an error.

Parsed on every render, which is why the preview follows the options

The file contains two components. A small one renders a single change line and takes the line plus the ordering as props, which is what lets the same line show a different proposed number depending on how the wizard is set to order the renumbering. The outer one is the field widget: it exposes a getter that parses the field's JSON, or returns the empty fallback, and passes the pieces to the template.

Parsing in a getter rather than in setup is the difference between this widget and several of its neighbours in the same module. Because the value is read on every render, changing an option on the wizard and having the server recompute the preview updates the panel in place. The batch sending summary next door, which reads its value once in setup, would not.

Odoo 16 did it differently again: the value was parsed in setup and re-parsed in a props-update hook, which achieved the same result with more machinery. Odoo 17 simplified it to the getter, and nothing has changed since.

There is no supported types declaration and no extractor, so the widget can be named on any field. What it needs in practice is a text field containing the object described above, which in core is produced by the wizard's own computation.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. Byte-identical to Odoo 19 on the development branch.
Odoo 19.0VerifiedVerified against the shipped source. Same as Odoo 17 and 18.
Odoo 18.0VerifiedIdentical behavior.
Odoo 17.0VerifiedThis is where parsing moved into a getter.
Odoo 16.0VerifiedSame contract and same rendering, but the value was parsed in setup and again on props updates.

Upgrade note. Nothing to do. The JSON contract and the registration name have been stable since Odoo 16, and only the internal parsing approach changed in Odoo 17. Custom modules that produce their own preview payload are unaffected.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The development branch is unstable and this can still change; we re-verify the page after release.

Byte-identical. The file on the development branch matches Odoo 19 exactly, including the getter-based parsing and the empty fallback. Any change to the preview will come from the wizard's server-side computation or its template.

Common problems and fixes

SymptomCause and fix
The preview is emptyThe field holds no value, so the widget falls back to an empty change list. Check the selection the wizard was opened on; an empty preview means nothing would be renumbered.
The preview does not match the ordering I choseThe ordering key in the payload is what the renderer uses, and it comes from the server computation. Re-check the wizard's ordering field; the panel follows what the server returned.
Nothing renders and there is a JSON errorThe field does not contain a valid JSON object of the expected shape. Make the server-side computation return an object with a change lines array and an ordering key.
Options are ignoredThe registration has no extractor, so nothing in the options dictionary is read. Nothing to configure.
Missing widget errorThe accounting module is not installed in that database. Install Invoicing or Accounting.

Resequence preview vs the alternatives

WidgetBest forKey difference
account_resequence_widgetShowing a before and after list before a renumbering is appliedParses a JSON payload on every render, so the preview follows the wizard's options
grouped_view_widgetTabular previews with configurable columnsColumns come from the payload rather than being fixed
account_batch_sending_summaryA wizard summary panelReads its value once, so it does not follow later changes
htmlFree-form server-generated previewsNo structure to match and no client-side parsing
open_move_widgetLinking from a line to its journal entryA navigation cell rather than a preview panel

Where a wizard needs to preview a tabular result and you control the payload, the grouped view widget is the more configurable option, since it takes its columns from the data. This one is worth naming only when your payload matches its shape. For a preview with no structure at all, an HTML field computed on the server needs no JavaScript.

Frequently asked questions

What does the resequence preview show?+
The journal entries that will be renumbered, with their current number and the number they will receive, in the order the renumbering will apply. The list is computed by the wizard on the server.
Why does the panel update when I change the wizard options?+
The widget parses the field's JSON inside a getter, so the value is read on every render. That is deliberately different from some neighbouring widgets, which read their value once.
What happens if the field is empty?+
The getter returns an empty change list ordered by date, so a fresh wizard shows an empty panel rather than raising an error.
Can I configure it?+
No. The registration provides only a component: no options, no extractor and no supported types. What the panel shows depends entirely on the payload.
Has it changed across versions?+
The contract has been stable since Odoo 16. Only the parsing approach changed, moving into a getter in Odoo 17, and the file is byte-identical from there through the Odoo 20 development branch.

Sequence gaps that an auditor will ask about

Numbering rules, gapless sequences and the corrections you are allowed to make differ by country, and they are easier to design than to repair. We set up Odoo document sequencing and localization on versions 16 through 19.

Book a free consultation

How this page was produced

The two components, the getter-based parsing, the empty fallback and the absence of options and supported types were read from account_resequence_field.js on the Odoo 19.0 branch, with the usage taken from the resequence wizard view in the same module. The Odoo 16 difference comes from the same file on that branch, and the Odoo 20 statement from a byte comparison against the public development branch. Spotted an error? Tell us and we will correct the page.