-
-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0][MIG] bi_view_editor #761
Conversation
* Add menu items creation feature * Added selection of fields of a tree view * Improved usability and strings made translatable * Avoid display duplicated nodes * Robustness * Updated Dutch translation * Avoid possible sql injection in bi_view_editor * Removed deprecated RegistryManager
Apostrophe in model name raised ValueError. Added needed migration script.
Add LEFT JOIN capabilities Add sums and avg capabilities for tree views Robustness and code review Provide ER diagram view for table relations
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: reporting-engine-12.0/reporting-engine-12.0-bi_view_editor Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-bi_view_editor/
…reliable behavior
pre-commit
Currently translated at 18.6% (17 of 91 strings) Translation: reporting-engine-14.0/reporting-engine-14.0-bi_view_editor Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-bi_view_editor/it/ [IMP] bi_view_editor : black, isort, prettier
Hi @huguesdk. Do you know @PierrickBrun from akretion is working on it since some weeks ? |
@legalsylvain ouch, this is unfortunate. i started working on this a while ago, and didn’t check since then. 🤦 @PierrickBrun, since you dived into the code on your side, what do you think of this version? |
I feel like this version is more finished than mine (ie. I did not look into translations at all atm, the drag/drop functionnality, the css on your side looks better) about the owl migration of the widget, it looks like we took similar paths. I made a first attempt at using a store to put the fields but I did not like that the children components would directly make changes to it so I used callbacks, like you did maybe we can use this one and take things that may be better in mine to complete it ? I will squash my commits to make it more readable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ivantodorovich should i just squash all commits after (and including) the migration commit to one?
bi_view_editor/__manifest__.py
Outdated
@@ -11,7 +11,9 @@ | |||
"category": "Productivity", | |||
"version": "16.0.1.0.0", | |||
"development_status": "Beta", | |||
"depends": ["web"], | |||
"depends": [ | |||
"spreadsheet_dashboard", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i also think that this is a quite big and useless dependency. what do you suggest? put it in base.menu_board_root
by default and add a glue module (auto-install) that depend on spreadsheet_dashboard
and moves the menu entry there?
what do you think, @PierrickBrun?
Yes, you can do that. If all the changes are strictly due to the migration process, then it makes sense to have all of them in a single "migration" commit. Though, if you have other improvements you can decide to put them in separate commits (optional, they can be on the migration commit, too). However if you do this, please write more descriptive commit messages and try to stick to the guidelines for formatting it. Messages like "add comment" don't say much 😓 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not totally at ease with owl, but LGTM from what I understand :)
This PR has the |
a279d7e
to
bc0a669
Compare
please note that in the odoo master branch, the legacy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
/ocabot merge nobump |
On my way to merge this fine PR! |
@HviorForgeFlow your merge command was aborted due to failed check(s), which you can inspect on this commit of 16.0-ocabot-merge-pr-761-by-HviorForgeFlow-bump-nobump. After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red. |
@huguesdk seems that pre-commit is failing https://github.com/OCA/reporting-engine/actions/runs/6781745670/job/18432619470#step:7:19 |
@HviorForgeFlow your merge command was aborted due to failed check(s), which you can inspect on this commit of 16.0-ocabot-merge-pr-761-by-HviorForgeFlow-bump-nobump. After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red. |
bc0a669
to
4aa7b19
Compare
@HviorForgeFlow i’ve just added the missing file. could you please retry? edit: i’m surprised that pre-commit forces the |
4aa7b19
to
8829e9f
Compare
/ocabot merge nobump |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at 79e0d02. Thanks a lot for contributing to OCA. ❤️ |
BVEEditor
widgetthe
BVEEditor
widget (in the “query builder” tab) has been converted to owl. this is quite a big change, almost a rewrite. it should work in exactly the same way as in 15.0 (except for one slight difference, as explained below, and little styling changes).the only difference that i’m aware of is that if a model is expanded in the left column and the model filter is changed, in 15.0 all models are collapsed, while now the ones that are still visible stay expanded if they were. i don’t know if the previous behavior was desired or was due to a technical limitation, and i think the current way makes sense, so i left it like that. doing it with owl in the same way as in 15.0 would be possible but cumbersome, because parent components cannot access their children components in an easy way (at least i didn’t find how to do it except by making children register themselves with their parent using a callback).
i tried to keep the existing logic as much as possible to lower the amount of changes. for example, the
FieldList
component still manages the data of the field list, and has.get()
and.set()
methods called directly by the main widget, which in a reactive framework like owl is a little weird.this is the first time i work with owl (learning it along the way), so there are probably things that are not done exactly like they should. for example, i didn’t succeed in using custom events to notify parent components of changes, so i used callbacks instead. all advice and comments are welcome.
known issues
in 16.0, translations are handled differently than before. the
ir.translation
table doesn’t exist anymore. because of this, i removed the translation smart button that was available on created bi views. the translations can be edited directly on the values themselves (name of the bi view and field names in the details tab).additionally, there are 2 things that don’t work anymore like they do in 15.0 because of how translations are handled:
en_US
value) instead of when it is displayed.translated fields are not supported in bi views.the 1st issue is due to how the models and fields are created: only one value is set as their name field, while internally the field is a json object. currently, the user’s language defines the value for the
en_US
language, regardless of which language it actually is.the 2nd issue is due to the fact that the code handles translated fields as regular fields while they need to be handled in a special way. here is how to reproduce the problem:create a new bi view.give it a name (or it won’t save, as it’s required).add the “country” → “country code” and “country” → “country name” fields.click on “generate bi view”.click on “open bi view”.problem: the “country name” column displays empty values.click on the pivot button on the top right.click on a “total” cell and select “country name”.the values displayed are all “[object Object]”.click on any of those values and select “country code”.problem: the following error is raised:any help to solve this is welcome.
edit
translated fields are now correctly supported.