mis-builder icon indicating copy to clipboard operation
mis-builder copied to clipboard

[16.0][IMP] - css sticky table header added on mis-builder reports

Open dora-jurcevic opened this issue 9 months ago • 11 comments

Thanks for your pull request. Please take a moment to review if it meets the following guidelines.

Description

Following the discussion on the PR for the same feature on V14 https://github.com/OCA/mis-builder/pull/588. The PR adds a sticky header and first column on the Mis budget report. On the first gif you can see the vertical scroll, on the second one the horizontal one.

mis-builder-vertical-scroll

mis-builder-sticky-header-horizontal-scroll

Thx !

dora-jurcevic avatar Mar 19 '25 15:03 dora-jurcevic

Hi @sbidoul, some modules you are maintaining are being modified, check this out!

OCA-git-bot avatar Mar 19 '25 15:03 OCA-git-bot

Hello, I tested (not on runboat) on a copy of a database we have with a wide report already configured. Unfortunately, the display is not so good, as you can see: Sélection_030

For comparison, this is the report with non sticky header in production database: Sélection_031

The stickyness is working for the title line, but the whole rendering is not working. Is it something in my database?!

vdewulf avatar Mar 24 '25 21:03 vdewulf

From a technical standpoint, I worry that these overrides of standard odoo css classes would have side effects in other contexts than mis builder? Not sure.

Also, is there a better solution than hard coding colors?

sbidoul avatar Mar 25 '25 13:03 sbidoul

Thank you all for the feedback. Ia I was advised, I decided to split in 2 different PRs the two features : sticky header + sticky first column. I added a commit with a refactor keeping only the sticky header in this PR. I hope it would be easier to test.

@sbidoul , thank you, I changed the colors by using the standard odoo bootstrap variables. Also, to reinsure that the classes don't interfere or override classes on other tables / views, I further nested the css classes with those only used on miss builder , for example : .oe_mis_builder_content .o_list_renderer thead th { position: -webkit-sticky; position: sticky; top: 0; background-color: var(--gray-300); z-index: 1; border: 0.2px solid var(--gray-100); }

Here the style applies only on html table header elements where the parent has oe_mis_builder_content class (and o_list_renderer ) applied . This ensures that the style won't apply on other odoo tables or lists. @vdewulf , would be great to see if my refactor works on your reports ! Thank you for you collaboration and testing !

dora-jurcevic avatar Mar 28 '25 09:03 dora-jurcevic

Thank you Dora. Can you update the PR title to reflect this?

sbidoul avatar Mar 28 '25 10:03 sbidoul

@dora-jurcevic I tested the last version on the runboat here and it doesn't seem to work. See my video. mis_report_sticky_header_test_runboat_18042025

vdewulf avatar Apr 18 '25 15:04 vdewulf

@dora-jurcevic I tested the last version on the runboat here and it doesn't seem to work. See my video. mis_report_sticky_header_test_runboat_18042025 mis_report_sticky_header_test_runboat_18042025

Thank you @vdewulf for testing. So on the OCA bot the testing is not really ideal beacuse the table has only 3 rows. For the sticky header to appear, the table should be bigger (heigher) than the screen . You can "cheat" by :

  • inspecting the table
  • selecting a element in the inspector tool
  • right click -> duplicate node
  • this will copy a row , and if you do it 15-20 times (easy peasy ;) ) , you can simulate a big table without having to reproduce enough data for a big report.
  • Hope this helps !

dora-jurcevic avatar Apr 18 '25 16:04 dora-jurcevic

I added many kpi's row in the runboat http://oca-mis-builder-16-0-pr673-458d6234f03c.runboat.odoo-community.org/web#id=1&cids=1&menu_id=120&action=281&model=mis.report&view_type=form the sticky header is working.

But i found that the report is squeezed in one page, this give difficult views if there are many columns in one report. It be good if the report can be freezed in the first column as well. thanks

hitrosol avatar Apr 29 '25 13:04 hitrosol

@dora-jurcevic Test successfull on my customer database.

As stated together previously, as a next improvement, the first column should be fixed, but with an attention to fix the width of the column because some of our customers have really (really) long names of accounts, as you will see in this GIF. mis_report_sticky_header_test_real-database_01052025

You need to fix the pre-commit aspects (no idea how) before we can merge this, after answering the last comments from @sbidoul. Thanks

vdewulf avatar May 01 '25 16:05 vdewulf

@dora-jurcevic I made https://github.com/akretion/mis-builder/pull/1 with the pre-commit fix and the changes I suggested above.

sbidoul avatar May 02 '25 15:05 sbidoul

I made akretion#1 with the pre-commit fix and the changes I suggested above.

@dora-jurcevic can you merge akretion#1 if ok for you?

sbidoul avatar May 07 '25 14:05 sbidoul

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). 🤖

OCA-git-bot avatar May 13 '25 14:05 OCA-git-bot

@sbidoul hello there! would you agree to merge this PR?

vdewulf avatar May 23 '25 09:05 vdewulf

I agree, but a git rebase is needed.

sbidoul avatar May 23 '25 13:05 sbidoul

I can do it in anoter PR if you prefer, preserving your authorship (of course).

sbidoul avatar May 23 '25 13:05 sbidoul

hello @sbidoul ! Please see this MR, I rebased the code and everything seems to be green now. Thx !

dora-jurcevic avatar Nov 03 '25 15:11 dora-jurcevic

Thank you Dora!

/ocabot merge minor

sbidoul avatar Nov 03 '25 15:11 sbidoul

On my way to merge this fine PR! Prepared branch 16.0-ocabot-merge-pr-673-by-sbidoul-bump-minor, awaiting test results.

OCA-git-bot avatar Nov 03 '25 15:11 OCA-git-bot

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

OCA-git-bot avatar Nov 03 '25 15:11 OCA-git-bot