Skip to content

[16.0][MIG] sql_request_abstract - #669

Merged
OCA-git-bot merged 57 commits into
OCA:16.0from
legalsylvain:16.0-mig-sql_request_abstract
Nov 23, 2022
Merged

OCA-git-bot merged 57 commits into
OCA:16.0from
legalsylvain:16.0-mig-sql_request_abstract

Conversation

@legalsylvain

@legalsylvain legalsylvain commented Oct 25, 2022

Copy link
Copy Markdown
Contributor
  • Add new main entry menu for SQL configuration
  • Add abstract tree view
  • Add abstract form view
  • ADD ace/mode-pgsql.js file to have syntaxic coloration in sql field
  • move has_grouped_changed from bi_sql_editor to sql_request_abstract

Note

indroduce ace for postgresql looks great ! See

image

Description

This module provides an abstract model to manage SQL Select requests on database.
It is not usefull for itself. You can see an exemple of implementation in the
'sql_export' module. (same repository).

Implemented features

  • Add some restrictions in the sql request:

    • you can only read datas. No update, deletion or creation are possible.
    • some tables are not allowed, because they could contains clear password
      or keys. For the time being ('ir_config_parameter').
  • The request can be in a 'draft' or a 'SQL Valid' status. To be valid,
    the request has to be cleaned, checked and tested. All of this operations
    can be disabled in the inherited modules.

  • This module two new groups:

    • SQL Request / User : Can see all the sql requests by default and execute
      them, if they are valid.
    • SQL Request / Manager : has full access on sql requests.

DEVELOP

Inherit the model:

    from odoo import models

    class MyModel(models.model)
        _name = 'my.model'
        _inherit = ['sql.request.mixin']

        _sql_request_groups_relation = 'my_model_groups_rel'

        _sql_request_users_relation = 'my_model_users_rel'

See implementations in the modules bi_sql_editor and sql_export. (same OCA/reporting-engine repository)

legalsylvain and others added 30 commits October 25, 2022 22:24
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-tools-12.0/server-tools-12.0-sql_request_abstract
Translate-URL: https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-sql_request_abstract/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-tools-12.0/server-tools-12.0-sql_request_abstract
Translate-URL: https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-sql_request_abstract/
Currently translated at 100.0% (21 of 21 strings)

Translation: server-tools-12.0/server-tools-12.0-sql_request_abstract
Translate-URL: https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-sql_request_abstract/zh_CN/
Currently translated at 100.0% (21 of 21 strings)

Translation: server-tools-12.0/server-tools-12.0-sql_request_abstract
Translate-URL: https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-sql_request_abstract/pt_BR/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-tools-12.0/server-tools-12.0-sql_request_abstract
Translate-URL: https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-sql_request_abstract/
@sebastienbeau

Copy link
Copy Markdown
Member

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-669-by-sebastienbeau-bump-patch, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Nov 16, 2022
Signed-off-by sebastienbeau
@OCA-git-bot

Copy link
Copy Markdown
Contributor

@sebastienbeau your merge command was aborted due to failed check(s), which you can inspect on this commit of 16.0-ocabot-merge-pr-669-by-sebastienbeau-bump-patch.

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.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

@sebastienbeau your merge command was aborted due to failed check(s), which you can inspect on this commit of 16.0-ocabot-merge-pr-669-by-sebastienbeau-bump-patch.

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.

@bealdav

bealdav commented Nov 18, 2022

Copy link
Copy Markdown
Member

I don't know why merge fails ? Error seems suggest than codecov needs to be green to be successful.
I thought that green codecov wasn't mandatory !?
Anybody know about this kind of things ?
cc @legalsylvain @sebastienbeau @sbidoul Thanks

@sbidoul

sbidoul commented Nov 18, 2022

Copy link
Copy Markdown
Member

@bealdav follow this path:

image

image

Conclusion: need to run pipx run copier -f update.

@legalsylvain

Copy link
Copy Markdown
Contributor Author

/ocabot rebase

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Sorry @legalsylvain you are not allowed to rebase.

To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons.

If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the maintainers key of its manifest.

@sbidoul

sbidoul commented Nov 18, 2022

Copy link
Copy Markdown
Member

@legalsylvain if the issue is fixed on the main branch, a rebase should not be necessary as the merge command merges before running the tests.

@bealdav

bealdav commented Nov 18, 2022

Copy link
Copy Markdown
Member

OK that's https://gitlab.com/PyCQA/flake8 close repository that Pedro mention on twitter.
Sorry @sbidoul for the noise I've just look into commit "[[MIG] sql_request_abstract from 15.0 to 16.0]" not the "[[UPD] Update sql_request_abstract.pot" because the last one is automatic.

Maybe needs a copier update to apply settings to the repo ?

@bealdav

bealdav commented Nov 18, 2022

Copy link
Copy Markdown
Member

Now fixed OCA/pylint-odoo#446

@bealdav

bealdav commented Nov 23, 2022

Copy link
Copy Markdown
Member

Please @HviorForgeFlow @faide @etobella could you give a new try to get PR merged. Thanks

@etobella

Copy link
Copy Markdown
Member

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

OCA-git-bot added a commit that referenced this pull request Nov 23, 2022
Signed-off-by etobella
@OCA-git-bot

Copy link
Copy Markdown
Contributor

@etobella your merge command was aborted due to failed check(s), which you can inspect on this commit of 16.0-ocabot-merge-pr-669-by-etobella-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.

@etobella

Copy link
Copy Markdown
Member

Prolem with the flake8-calypse. IT should be fixed now 🙏

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-669-by-etobella-bump-nobump, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit f9095c7 into OCA:16.0 Nov 23, 2022
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 705585d. 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.