Skip to content

Commit b68569c

Browse files
committed
[IMP] util.merge_module
Explicit exception when `into` module does not exists, instead of an obscure KeyError. Part-of: #315 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent cb77ad0 commit b68569c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/util/modules.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,12 @@ def merge_module(cr, old, into, update_dependers=True):
395395
if old not in mod_ids:
396396
# this can happen in case of temp modules added after a release if the database does not
397397
# know about this module, i.e: account_full_reconcile in 9.0
398-
# `into` should be know. Let it crash if not
399398
_logger.log(NEARLYWARN, "Unknown module %s. Skip merge into %s.", old, into)
400399
return
401400

401+
if into not in mod_ids:
402+
raise UnknownModuleError(into)
403+
402404
def _up(table, old, new):
403405
cr.execute(
404406
"""

0 commit comments

Comments
 (0)