From 831ebad6314ae492c25b07b88fdb837f13b6e553 Mon Sep 17 00:00:00 2001 From: Roy Le Date: Tue, 8 Feb 2022 09:50:50 +0700 Subject: [PATCH] [IMP] upgrade_path: support upgrade paths (separated by commas) --- openupgradelib/openupgrade.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openupgradelib/openupgrade.py b/openupgradelib/openupgrade.py index 9c7ff907..c0a99b1c 100644 --- a/openupgradelib/openupgrade.py +++ b/openupgradelib/openupgrade.py @@ -294,9 +294,13 @@ def load_data(cr, module_name, filename, idref=None, mode='init'): fp = tools.file_open(pathname) except OSError: if tools.config.get('upgrade_path'): - pathname = os.path.join( - tools.config['upgrade_path'], module_name, filename) - fp = open(pathname) + for path in tools.config['upgrade_path'].split(','): + pathname = os.path.join(path, module_name, filename) + try: + fp = open(pathname) + break + except OSError: + pass else: raise