Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] Support for --upgrade-path #218

Merged

Conversation

StefanRijnhart
Copy link
Member

@StefanRijnhart StefanRijnhart commented Dec 6, 2020

Adapting load_data to search for the file to load in the --upgrade-path if it cannot be found in the module directory tree.

openupgradelib/openupgrade.py Outdated Show resolved Hide resolved
@StefanRijnhart StefanRijnhart force-pushed the add/14.0/upgrade_path__apriori_json branch from d834f61 to 53a90a0 Compare December 9, 2020 21:24
@StefanRijnhart StefanRijnhart changed the title [ADD][14.0] Support for --upgrade-path and apriori.json [ADD] Support for --upgrade-path Dec 9, 2020
Copy link
Contributor

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks.

@StefanRijnhart StefanRijnhart force-pushed the add/14.0/upgrade_path__apriori_json branch from 53a90a0 to 6ae6148 Compare December 10, 2020 12:03
@StefanRijnhart
Copy link
Member Author

Thanks for the reviews. I noticed a slight logical error that I just fixed

+++ b/openupgradelib/openupgrade.py
@@ -278,7 +278,9 @@ def load_data(cr, module_name, filename, idref=None, mode='init'):
         if tools.config.get('upgrade_path'):
             pathname = os.path.join(
                 tools.config['upgrade_path'], module_name, filename)
-        fp = open(pathname)
+            fp = open(pathname)
+        else:
+            raise
 
     try:
         if ext == '.csv':

@pedrobaeza pedrobaeza merged commit 519a093 into OCA:master Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants