Skip to Content

Contributors

Re: Module loading priority and inheritance

Richard, I understand your concern about the priority number, but having it in our toolbox could still be extremely useful.

As a first step, I made a PR that implements both:

Contrary to my original proposal, I don't alter the SQL query, the sorting is done in python like the dependency loading by using the manifest attributes (not stored in the DB)



by Yann Papouin - 03:21 - 17 Jun 2022

Reference

  • Module loading priority and inheritance
    Hi,

    I just installed the auth_totp module to add MFA support to our odoo 12.0 instance and its behaviour is totally broken after a server restart when the auth_ldap module is also installed.

    Because _check_credentials logic is just made to accept at least one Valid authentication and not globally refuse any authentication, the current implementation of the auth_totp will always fail if a module validate _check_credentials after that the MfaLoginNeeded exception is raised.

    To me it's more a framework issue and the manifest should allow a new priority value to sort modules without inter-dependencies (because actually, it seems to use an alphabetic sorting based on module name).
    But without this, how do you handle such situations ?

    --
    Yann PAPOUIN, Ingénieur R&D | DEC


    by Yann Papouin - 03:31 - 15 Jun 2022