[16.0][IMP] mis_builder: introduce annotation in reports
This PR introduces 'annotation' in mis_builder reports. An annotation is a comment or a remark that a user can write on a cell.
It tries to solve issue: #159 (opened 6 yeas ago!)
Description
The goal is to write a remark on a cell (independently of the pivot date). These annotations are visible directly within the view but also at export in .pdf and in .xlsx.
Edit: 2 security groups have been introduced to allow edit and read of annotaitons Edit 2: It is not possible to add a note on a line that comes from the option "details by account"
Overview
UI in mis_builder_widget
On cells, we have now a drop down menu to drill down or annotate:
It opens a window to write an annotation:
Print .pdf
The annotation is also present in the .pdf:
Export .xls
In the .xls, the annotation are added as 'comment' on cells:
Hi @sbidoul, some modules you are maintaining are being modified, check this out!
Long wait feature finally come.
I tried on runboat using Chrome, Edge and Safari. The drop down menu is behind the other row.
It looks okay on Firefox, but no sequence number is added in the footnotes. If I refresh the browser the notes is gone.
Thanks
Long wait feature finally come.
It was just waiting for someone to fund it.
Long wait feature finally come.
I tried on runboat using Chrome, Edge and Safari. The drop down menu is behind the other row.
It looks okay on Firefox, but no sequence number is added in the footnotes. If I refresh the browser the notes is gone.
Thanks
Thanks for your feedback.
I am using firefox but I'll try to figure out why it doesn't work with other browsers.
Regarding the annotations, I opened your instance and indeed, it doesn't work with your column '3 M Budget' but it works with others. I'll fix it:
Long wait feature finally come.
I tried on runboat using Chrome, Edge and Safari. The drop down menu is behind the other row.
It looks okay on Firefox, but no sequence number is added in the footnotes. If I refresh the browser the notes is gone.
Thanks
It should be fixed now. Thanks for your feedback!
It works well!
Would it be possible to make the annotations company-dependent? This would allow each company to have its own comments if the report is shared between several companies.
Thanks for your feedback!
Annotations are now linked to a company. This company is the 'main' company of the user when creating the annotation.
Annotations are now linked to a company. This company is the 'main' company of the user when creating the annotation.
Is that not potentially surprising for the user?
For instance, what if it is a multi-company consolidation report?
I wonder to what extent the annotation should be linked to (some of) the filter values of the report (effective companies, pivot date, ...).
Annotations are now linked to a company. This company is the 'main' company of the user when creating the annotation.
Is that not potentially surprising for the user?
For instance, what if it is a multi-company consolidation report?
I figured that the 'final user' would always use the same 'main company' when watching his report. Therefore, in my case, it makes sense to attach annotations to the 'main company'. What would you prefer? Storing every companies selected when watching the report?
I wonder to what extent the annotation should be linked to (some of) the filter values of the report (effective companies, pivot date, ...).
I thought about adding the pivot date but realized that in odoo enterprise, they also have an 'annotation' feature but they don't store the pivot date. The annotation is linked to the 'cell'.
I wonder to what extent the annotation should be linked to (some of) the filter values of the report (effective companies, pivot date, ...).
I changed a bit my code:
- I removed the field 'company_id' on annotations
- I introduced a 'annotation_context' that represents the context in which an annotation has been added and in which we should display an annotation.
For now, I only use the 'query_company_ids' from the mis report instance.
So, let's say that we have a report that can be used on company A and B. I am on company A and I add a note. This note will be visible only if I display the report from company A (without company B). If I add a note while having company A and B selected, this note will be displayed on the report only if I have company A and B selected.
Here are a few remarks about ergonomy:
* Now the cells where there is no drill down are underlined on hover. It is important that this underline appears only as visual cue that a drilldown is possible, as before. * After adding an annotation I had to refresh to see it. Is that intended? * Removing an annotation leaves a weird display, with the little call out still present until I refresh
I think it's important that the annotation changes appear correctly immediately, and without requiring a full recompute.
Tested with chrome on the demo report on runboat.
Thanks for your feedback. I have done some changes, those ergonomic issues are fixed. Now, the loading of notes can be triggered independently from the computation of the matrix of a report!
I have done some changes and improvements that were asked.
I've done multiple commits in order to make the review easier. Once everything will be "approved", I'll squash all my commits.
A few more details.
If disabled menu items don't work I really prefer to have the little triangle with an empty menu so figures stay aligned. Can yo also put a little space between the cell content and the arrow?
Otherwise I think its almost done. Thanks a lot!
Thanks again for your review.
Here is how it looks now with some padding and the drop-down button greyed out:
There is still an alignment problem:
Also, can we tweak the pdf a little bit?
- In cells, make a reserved space for the footnoote callout so figures remain aligned? Add this reserved space in all cells only if there is at least one note?
- Remove the bullets in the bottom footnotes list (in books or documents we usually see the footnote number, it's enough and nicer).
- Add a some padding between the bottom footnotes list and the table.
In cells, make a reserved space for the footnoote callout so figures remain aligned? Add this reserved space in all cells only if there is at least one note?
In the widget too?
There is still an alignment problem:
Finally :+1:
- The structure of the note with line breaks is not retained in footnotes.
- Is it possible that when we click on the footnote number, we are redirected to the footnote in the report?
Rich text annotations might be a can of worms :) And it's not really a footnote anymore (if we compare to books or documents). Is that an important use case?
Is it possible that when we click on the footnote number, we are redirected to the footnote in the report?
Which makes me think. In the widget is it not better to display footnotes on hover? In large reports where the footnotes be far below the view it would make them easier to view.
Is it possible that when we click on the footnote number, we are redirected to the footnote in the report?
Which makes me think. In the widget is it not better to display footnotes on hover? In large reports where the footnotes be far below the view it would make them easier to view.
I'll add it on hover but it is possible to directly see the annotation by opening the wizard to edit the annotation
It is possible to directly see the annotation by opening the wizard to edit the annotation
Except if you are a readonly user?
Rich text annotations might be a can of worms :) And it's not really a footnote anymore (if we compare to books or documents). Is that an important use case?
What I can do is allowing multi line note and display as:
It is possible to directly see the annotation by opening the wizard to edit the annotation
Except if you are a readonly user?
In deed!
I've added:
- Displaying note when hovering the sequence of annotation
- Clicking on annotations triggers a scroll down to the section of note
- In the footnotes, when clicking on the number of a note, it will scroll up to the corresponding note
- Multi line notes are displayed in multi line instead of forcing it into one line
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). 🤖
The 'drill down' seems to be broken, I'll fix it.
Fixed!
If there are no additional comments I'll merge next week.
/ocabot merge minor
Hey, thanks for contributing! Proceeding to merge this for you. Prepared branch 16.0-ocabot-merge-pr-676-by-sbidoul-bump-minor, awaiting test results.
Congratulations, your PR was merged at adc42e27e907f3e33b6df924b211022bbbcac327. Thanks a lot for contributing to OCA. ❤️






