Skip to content

Commit

Permalink
Merge pull request #277 from royleviindoo/v14_upgrade_paths
Browse files Browse the repository at this point in the history
[IMP] upgrade_path: support upgrade paths (separated by commas)
  • Loading branch information
pedrobaeza authored Feb 8, 2022
2 parents 0a74206 + 831ebad commit 0911623
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions openupgradelib/openupgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0911623

Please sign in to comment.