-
Notifications
You must be signed in to change notification settings - Fork 26k
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
[IMP] Move SUPERUSER_ID to odoo.api #182371
base: master
Are you sure you want to change the base?
Conversation
ac0fdd1
to
b1c05ce
Compare
7b68103
to
0665b4b
Compare
PR is rebased and ready. @odoo/rd-security The security warning in |
0665b4b
to
01fd2f1
Compare
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.
The day we make odoo
a pure package, we'll no longer be able to import odoo
and then use odoo.something
unless odoo.something
is imported. It means that one day odoo.api.SUPERUSER_ID
is going to break unless import odoo.api
.
We can decide to postpone the problem to later, we'll have MANY files to update in the future anyway.
3a447c9
to
7f5c07b
Compare
I have made changes according to your comments. If the module is loaded it won't fail. So if you do this in an addon, |
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.
Can we please slow down a bit, and take a step back?
What I see coming will make the use of odoo
more painful for developers for, and the added value is purely technical. As Odoo developers, we clearly are losing value.
The real problem is not odoo
, it's odoo.addons
, isn't it?
This really feels like the wrong solution to me.
Removing the init means we need to do declare these variables elsewhere. Without an init, the order of loading sub-packages of (task-4035335 for more details) |
Here is the problem that we are trying to solve: we want the addons to be in a native namespace package. This would enable any decent IDE to figure out what I think that making Can't we find a better solution? What about making
I am sorry, but all this is about a non-existing problem. The module |
The thing is that any decent IDE cannot figure out that |
7f5c07b
to
af3027a
Compare
In order to become a native namespace, `odoo` package must not contain any variables. This is a step in that direction. odoo.api.SUPERUSER_ID is often used with Environment, so we declare both in the same package. task-4069446
af3027a
to
f9d3121
Compare
task-4069446
f9d3121
to
70ba082
Compare
Description of the issue/feature this PR addresses:
Move
odoo.SUPERUSER_ID
toodoo.api.SUPERUSER_ID
.In order to become a namespace package,
odoo
package should not contain any variables, only modules.odoo/enterprise#71223
odoo/upgrade#6585
odoo/upgrade-util#144
task-4069446
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr