Skip to content

Commit a0a72fb

Browse files
elre-odooaj-fuentes
authored andcommitted
[FIX] util/domains.py: Restore compatibility with 7.0
Importing util leads to importing everything from util/domains, including `ignore()` from opernerp.tools.misc which got introduced after 7.0. We change the ignore import to fallback to None if not found, so that the rest of the util import can continue (like we already do in for the ofields import in orm.py, introduced in e321b12). closes #7 Signed-off-by: Alvaro Fuentes Suarez (afu) <[email protected]>
1 parent 2b3932a commit a0a72fb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/util/domains.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
from contextlib import suppress
1010
except ImportError:
1111
# python2 code, use the openerp vendor
12-
from openerp.tools.misc import ignore as suppress
12+
try:
13+
from openerp.tools.misc import ignore as suppress
14+
except ImportError:
15+
# this is to allow v7.0 DBs to import this module without errors
16+
# note: some functions on this module will fail (like adapt_domains)
17+
suppress = None
1318

1419
try:
1520
from html import unescape

0 commit comments

Comments
 (0)