Skip to content
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

[12.0][ENH] sql view - allow group operator #352

Merged
merged 4 commits into from Mar 28, 2020

Conversation

richard-willdooit
Copy link

Replaces #345

Adds the possibility, for float and integer columns, to
apply a group operator (average, min, max).

Replaces OCA#345

Adds the possibility, for float and integer columns, to
apply a group operator (average, min, max).
@bealdav
Copy link
Member

bealdav commented Nov 28, 2019

@legalsylvain

Copy link
Contributor

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

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

Hi @richard-willdooit
Thanks a LOT, for this improvment !
That is for sure a big limitation of the current module bi_sql_editor.
What about to integrate this code to the main module. I don't see the interest to add a very important feature in an extra module. What do you think ?

(partial code review for the time being).

('max', 'Maximum'),
]

_GRAPH_TYPE_SELECTION = [
Copy link
Contributor

Choose a reason for hiding this comment

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

where it is used ?

super()._add_manual_fields(model)
if 'bi.sql.view' in self.env:
Sql = self.env['bi.sql.view']
if hasattr(Sql, 'check_manual_fields'):
Copy link
Contributor

Choose a reason for hiding this comment

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

why this check ?
I guess that it is allways true, if the module is installed ? or did I missed something ?

Copy link
Author

Choose a reason for hiding this comment

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

@legalsylvain This check MAY be unnecessary now, but see my comment below....

@richard-willdooit
Copy link
Author

@legalsylvain I first wrote this as an integrated part of the module - see #344 and #345 - however, due to the override of add_manual_fields, upgrading when adding the module turned in to a nightmare - there were times during the instanciation of the models when certain fields and attributes were not yet available or visible. As it is, we need to be careful if it gets merged in to the one module.

I was much happier integrating it to the single module, but I had trouble upgrading two production instances for different issues (it depended on the order that models and fields were being added) - in the worse of the two, I had a maximum recursion every time the odoo server started, and I was only able to get the module installed by manipulating column definitions directly with PostgreSQL - not pretty. @CasVissers had a similar problem on #344

I am happy to re-propose the previous two PRs, but I cannot work out a clean and always reproducable upgrade 😕

@richard-willdooit
Copy link
Author

@legalsylvain Do you know what we need to do to get this merged?

Copy link
Contributor

@legalsylvain legalsylvain 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

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

@legalsylvain
Copy link
Contributor

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 12.0-ocabot-merge-pr-352-by-legalsylvain-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit af7ffca into OCA:12.0 Mar 28, 2020
@OCA-git-bot
Copy link
Contributor

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

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.

None yet

4 participants