Skip to content

[20.0][MIG] web_remember_tree_column_width: Migration to 20.0 - #3751

Open
mcastillol14 wants to merge 29 commits into
OCA:20.0from
mcastillol14:20.0-mig-web_remember_tree_column_width
Open

mcastillol14 wants to merge 29 commits into
OCA:20.0from
mcastillol14:20.0-mig-web_remember_tree_column_width

Conversation

@mcastillol14

Copy link
Copy Markdown

Standard migration of web_remember_tree_column_width to 20.0, following the usual git format-patch/git am procedure to preserve commit history and authorship. Only change needed: manifest version bump to 20.0.1.0.0. No code changes (single JS asset, no Python, no tests).

frahikLV and others added 28 commits October 23, 2026 11:37
… widths

Remember the tree columns' widths across sessions, and after filtering, grouping, or reordering.
this fixes scss file not found error after installing the module
…on column

Fix an error when retrieving column sizes for lists containing one or more list_button columns.
This error occurs when a list_button column is placed between other columns in the list. This type of column is excluded from the querySelector string used to retrieve column headers, which can cause the index to shift and the column size to change when the list is displayed.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: web-17.0/web-17.0-web_remember_tree_column_width
Translate-URL: https://translation.odoo-community.org/projects/web-17-0/web-17-0-web_remember_tree_column_width/
Co-authored-by: Stefan Rijnhart <stefan@opener.amsterdam>
Fixes
```
Uncaught Javascript Error > Cannot read properties of undefined (reading 'isRTL')
```

when trying to resizing a column in a list view.

Caused by upstream change odoo/odoo#210559
Analogous to the inherited code, the event listener would work on the resize
stop event, but this event would regularly not have the same target as the
resize start event in which case the field name and size could not be
determined.
@OCA-git-bot OCA-git-bot added mod:web_remember_tree_column_width Module web_remember_tree_column_width series:20.0 labels Oct 23, 2026
@mcastillol14 mcastillol14 mentioned this pull request Oct 23, 2026
2 of 36 tasks

@BhaveshHeliconia BhaveshHeliconia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally not working

Quotations.mp4

@mcastillol14

Copy link
Copy Markdown
Author

Thanks for testing this and recording the video, @BhaveshHeliconia — you were right, it was functionally broken.

I set up a real Odoo 20.0 instance (official odoo:20.0 image) and reproduced the bug with Playwright: the column width was saved to localStorage correctly on resize, but never restored after a page reload.

Root cause: the migration only bumped the version number but missed several real breaking changes in the OWL version shipped with 20.0 (signal-based reactivity):

  • tableRef is now a callable signal ref (tableRef()), not a classic Ref object (tableRef.el).
  • useMagicColumnWidths moved from a static class property to an instance property, so it must be read as renderer.useMagicColumnWidths instead of renderer.constructor.useMagicColumnWidths.
  • useComponent and useExternalListener no longer exist in owl; the component instance now has to be passed in explicitly, and useListener replaces useExternalListener.
  • setStoredColumnWidths also needed a guard for when the table ref isn't attached yet (effect runs once before mount), otherwise it throws Cannot read properties of null (reading 'querySelectorAll').

Just pushed a fix with all of the above. Verified against a real Odoo 20.0 container: resizing a column and reloading the page now keeps the new width, with no console errors.

Could you re-test when you have a chance?

@BhaveshHeliconia

Copy link
Copy Markdown
Contributor

Functionally working now, But squash the last commit into the migration commit.

@mcastillol14
mcastillol14 force-pushed the 20.0-mig-web_remember_tree_column_width branch from 125b1d8 to cb599b3 Compare October 26, 2026 09:18
@mcastillol14

Copy link
Copy Markdown
Author

Done, squashed the fix into the migration commit. Thanks for confirming it's working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:web_remember_tree_column_width Module web_remember_tree_column_width series:20.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.