Repository navigation
Conversation
Odoo switched to Bootstrap 5 in 15.0, so the direction-based classes from Bootstrap 4 silently stop doing anything from that version on. Nothing converts them today, and they survive migrations: OCA/web still has four files carrying them on 16.0. Only the renames with one unambiguous replacement are here. Classes that Bootstrap 5 dropped without a drop-in replacement (form-group, form-row, btn-block, media, jumbotron, card-deck, input-group-append/prepend, custom-control) need the markup rethought and are better reported as warnings than rewritten. The rules live in migrate_allways rather than migrate_140_150 because the classes are inert from 15.0 on, so converting them is safe at any step, and a module reaching 17.0 with Bootstrap 4 classes left would never see a 14.0 to 15.0 script again. Every rename is taken from the utilities API of the Bootstrap that Odoo bundles: margin-start/end are ms/me, padding-start/end are ps/pe, text-align takes start/end/center, float takes start/end/none, font-weight is fw and font-style is fst.
bosd
force-pushed
the
bootstrap5-classes
branch
from
October 1, 2026 17:49
75d5243 to
f261db9
Compare
Merged
4 tasks done
bosd
added a commit
to bosd/odoo-lint
that referenced
this pull request
Oct 8, 2026
…rade rules (#19) The XML data files a module's manifest loads (data, demo, qweb and assets globs) are now linted, per module: duplicate record and template ids span files, and version-gated checks follow the module's own manifest version, as OCA's checks do (a short or missing version is the target version, a malformed one skips them). XML001-XML024 reimplement oca-checks-odoo-module's XML checks with the same names; all 717 findings on its test repository match by file, line and check, including libxml2's line numbering of multi-line start tags. Fixes: XML declaration, redundant module name, attribute order (layout kept), eval for boolean and numeric fields, t-esc/t-raw to t-out, res.groups category_id removal (unsafe). XML101 renames Bootstrap 4 classes that Bootstrap 5 renamed (Odoo 15.0+) in class attributes, with a safe fix; XML102 reports the ones it removed. The renames follow OCA/odoo-module-migrator#173. Co-authored-by: bosd <5e2fd43-d292-4c90-9d1f-74ff3436329a@anonaddy.me>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Odoo moved to Bootstrap 5 in 15.0, so the Bootstrap 4 direction classes stop doing anything from that version on. Nothing converts them, so they survive migrations. Counting files in OCA/web:
Four files on 16.0 still carry classes that have no effect.
This adds the 22 renames that have one unambiguous replacement: spacing (
ml-,mr-,pl-,pr-), text alignment, float, border and rounded directions, dropdown alignment, the typography helpers, andsr-only,badge-pill,custom-select,no-gutters.Left out: what Bootstrap 5 dropped without a replacement, like
form-group,form-row,btn-block,media,jumbotron,card-deck,input-group-appendandcustom-control. Those need the markup rethought, so a warning suits them better than a rewrite. Can add that separately if you want it..xmlonly. Renaming a.ml-3selector in a module's own scss would break that stylesheet instead of fixing it.I put it in
migrate_allwaysbecause the classes are inert from 15.0 on, so converting them is safe at any step, and a module that reached 17.0 with them still in place would never see a 14.0 to 15.0 script again.string_attribute_in_tree_view.yamlalready works that way. Happy to move it tomigrate_140_150, though there is no 14.0 fixture yet.The renames come from the utilities API of the Bootstrap that Odoo bundles rather than from the changelog, so
ms/me,ps/pe,text-start/text-end,float-start/float-end,fw-andfst-.The fixture runs through the existing
test_migration_180_190. It also covers what must not change:o_ml-2,my-ml-3,mt-2,mx-auto,text-lefty,o-text-rightandml-6.