Skip to content

Commit

Permalink
[IMP] core: move SUPERUSER_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
kmagusiak committed Oct 1, 2024
1 parent 0833a35 commit d614691
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def setUp(self):
super().setUp()
self._setup_registry()
self.cr = self.registry.cursor()
self.env = api.Environment(self.cr, odoo.SUPERUSER_ID, {})
self.env = api.Environment(self.cr, api.SUPERUSER_ID, {})
self.addCleanup(self.env.clear)
self.addCleanup(self.cr.close)

Expand Down
6 changes: 5 additions & 1 deletion src/util/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@
from mock import patch

try:
from odoo import SUPERUSER_ID, modules, release
try:
from odoo.api import SUPERUSER_ID
except ImportError:
from odoo import SUPERUSER_ID
from odoo import fields as ofields
from odoo import modules, release
except ImportError:
from openerp import SUPERUSER_ID, modules, release

Expand Down
6 changes: 5 additions & 1 deletion src/util/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
Markup = None

try:
from odoo import SUPERUSER_ID, release
try:
from odoo.api import SUPERUSER_ID
except ImportError:
from odoo import SUPERUSER_ID
from odoo import release
from odoo.tools import html_escape
from odoo.tools.mail import html_sanitize
except ImportError:
Expand Down

0 comments on commit d614691

Please sign in to comment.