Skip to content

Conversation

@legalsylvain
Copy link
Contributor

@legalsylvain legalsylvain commented Oct 25, 2022

  • 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
Member

/ocabot merge patch

@OCA-git-bot
Copy link
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
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
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
Copy link
Member

bealdav commented Nov 18, 2022

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
Copy link
Member

sbidoul commented Nov 18, 2022

@bealdav follow this path:

image

image

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

@legalsylvain
Copy link
Contributor Author

/ocabot rebase

@OCA-git-bot
Copy link
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
Copy link
Member

sbidoul commented Nov 18, 2022

@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
Copy link
Member

bealdav commented Nov 18, 2022

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
Copy link
Member

bealdav commented Nov 18, 2022

Now fixed OCA/pylint-odoo#446

@bealdav
Copy link
Member

bealdav commented Nov 23, 2022

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

@etobella
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
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
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
Member

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

/ocabot merge nobump

@OCA-git-bot
Copy link
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
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.