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 Jan 24, 2025
1 parent 41b82ab commit d1652b6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
from odoo.tests.common import MetaCase
except ImportError:
MetaCase = None

try:
from odoo.api import SUPERUSER_ID
except ImportError:
from odoo import SUPERUSER_ID

try:
from unittest.mock import patch
except ImportError:
Expand Down Expand Up @@ -177,7 +183,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, 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 d1652b6

Please sign in to comment.