Skip to content

Conversation

@JasminSForgeFlow
Copy link
Contributor

Standard Migration

Adapt 18.0 new hook code for change/update width of list

@ForgeFlow

@JasminSForgeFlow JasminSForgeFlow marked this pull request as ready for review March 7, 2025 11:45
Copy link

@AaronHForgeFlow AaronHForgeFlow left a comment

Choose a reason for hiding this comment

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

Functional review 👍 Thank you.

Can't do a proper code review, as my knowledge in js is limited. Added a couple of minor comments.

@JasminSForgeFlow JasminSForgeFlow force-pushed the 18.0-mig-web_remember_tree_column_width branch from 1db02d7 to f26d5a3 Compare March 10, 2025 09:04
Copy link

@AaronHForgeFlow AaronHForgeFlow left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM functional + soft code review 👍

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@sanderlienaerts
Copy link

Can we get this PR merged?

@mylbco
Copy link

mylbco commented Apr 22, 2025

Can we get this merged ?

1 similar comment
@salimChoura1
Copy link

Can we get this merged ?

@BT-aleonard
Copy link

Can we merge this, please?

Copy link
Member

@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

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

Mmm, this looks like a modified copy of https://github.com/odoo/odoo/blob/18.0/addons/web/static/src/views/list/column_width_hook.js. Is it documented anywhere that this is the case? Are the changes annotated properly? Is there a more maintainable way of reusing at least parts of the code in that file?

@JasminSForgeFlow
Copy link
Contributor Author

Mmm, this looks like a modified copy of https://github.com/odoo/odoo/blob/18.0/addons/web/static/src/views/list/column_width_hook.js. Is it documented anywhere that this is the case? Are the changes annotated properly? Is there a more maintainable way of reusing at least parts of the code in that file?

that is used as a hook, and it is not possible to inherit it

@StefanRijnhart
Copy link
Member

StefanRijnhart commented Apr 24, 2025

Mmm, this looks like a modified copy of https://github.com/odoo/odoo/blob/18.0/addons/web/static/src/views/list/column_width_hook.js. Is it documented anywhere that this is the case? Are the changes annotated properly? Is there a more maintainable way of reusing at least parts of the code in that file?

that is used as a hook, and it is not possible to inherit it

But items like function getWidthSpecs or the various constants seem unchanged. Can't you at least import these items from the Odoo code? Or is it because they are not exported?

@StefanRijnhart
Copy link
Member

In any case, please document the origin of the code and annotate your changes to it.

frahikLV and others added 11 commits April 24, 2025 17:26
… 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.
@StefanRijnhart
Copy link
Member

@JasminSForgeFlow Thanks. You can squash my commit in your migration commit and share credits by mentioning me with Co-authored-by: in the commit message.
Do you experience the same issue with the missing th in which case the modified size is not stored? Maybe we should mention it as a known issue.

@JasminSForgeFlow
Copy link
Contributor Author

@JasminSForgeFlow Thanks. You can squash my commit in your migration commit and share credits by mentioning me with Co-authored-by: in the commit message. Do you experience the same issue with the missing th in which case the modified size is not stored? Maybe we should mention it as a known issue.

Sure, I'll update commit.

I haven't faced such issue, have you faced an issue with users' last view?

@StefanRijnhart
Copy link
Member

@JasminSForgeFlow Yes, as I indicated I encountered the same error, but uncaught in your version on this PRs runbot. See the screenshot above. I am now catching this condition, but the size cannot be stored in that case.

@JasminSForgeFlow
Copy link
Contributor Author

@JasminSForgeFlow Yes, as I indicated I encountered the same error, but uncaught in your version on this PRs runbot. See the screenshot above. I am now catching this condition, but the size cannot be stored in that case.

But you mentioned that you solved it in your version, didn't you?

@StefanRijnhart
Copy link
Member

@JasminSForgeFlow unfortunately, I did not see how to solve the issue. Like I said,

I also check if th is null in one of the events. It solves an exception that also occurs in version. When it happens, the event passes a th element that can not be used to retrieve the td. The only thing is, when that happens, the modified column width is not stored. Not sure if this is a critical issue.

Co-authored-by: Stefan Rijnhart <stefan@opener.amsterdam>
@JasminSForgeFlow JasminSForgeFlow force-pushed the 18.0-mig-web_remember_tree_column_width branch from 4b7f50c to b558c28 Compare April 28, 2025 08:56
@JasminSForgeFlow
Copy link
Contributor Author

@JasminSForgeFlow unfortunately, I did not see how to solve the issue. Like I said,

I also check if th is null in one of the events. It solves an exception that also occurs in version. When it happens, the event passes a th element that can not be used to retrieve the td. The only thing is, when that happens, the modified column width is not stored. Not sure if this is a critical issue.

Okay, I have added it to know issue, and commit is also updated.
Thanks

Copy link
Member

@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

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

Thanks for taking my suggestions!

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Copy link

@TomAlbrechtQuatra TomAlbrechtQuatra left a comment

Choose a reason for hiding this comment

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

Functional & Technical review
Thanks!

@StefanRijnhart
Copy link
Member

@OCA/web-maintainers this one should be ready for merge

Copy link
Member

@etobella etobella left a comment

Choose a reason for hiding this comment

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

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 18.0-ocabot-merge-pr-3114-by-etobella-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 92efcbf into OCA:18.0 Apr 29, 2025
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at feca976. Thanks a lot for contributing to OCA. ❤️

@MiquelRForgeFlow MiquelRForgeFlow deleted the 18.0-mig-web_remember_tree_column_width branch April 29, 2025 13:33
@StefanRijnhart
Copy link
Member

FYI this module broke 4 days ago due to a change in Odoo. Fixed in #3177

@Bart-dh
Copy link

Bart-dh commented Aug 7, 2025

@JasminSForgeFlow This does not work at all in Odoo 18 Enterprise edition. Is it only tested in CE, or is there perhaps something interfering in our database?

@etobella
Copy link
Member

etobella commented Aug 7, 2025

It is tested in CE, not in EE, as some of us don't have access to EE. Actually, OCA only tests in CE. If you want, you can try to find the reason and make it compatible.

@StefanRijnhart
Copy link
Member

StefanRijnhart commented Aug 7, 2025

@Bart-dh Using this in EE, but check the known issue discussed above. For us, it works most of the time.

-- edit -- meant to say EE.

@AaronHForgeFlow
Copy link

I tested it in EE and no issues so far.

@StefanRijnhart
Copy link
Member

@Bart-dh I'm suspecting there may be an issue with list views that contain buttons. Buttons may mess up the mapping of fields to list columns. Are there buttons in the views that don't work for you?

@Bart-dh
Copy link

Bart-dh commented Aug 29, 2025

@Bart-dh I'm suspecting there may be an issue with list views that contain buttons. Buttons may mess up the mapping of fields to list columns. Are there buttons in the views that don't work for you?

Ahh yes, indeed there are buttons! There is the default 'View record' button, but also custom buttons.

@StefanRijnhart
Copy link
Member

I fixed the roadmap issue from this PR in #3273, because it becomes quite prevalent in busy treeviews. @Bart-dh you might want to try that version to see if it solves your problems as well.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.